Esempio n. 1
0
    def update_publisher(self, publisher):
        """Update a Gnip filter.

        @type publisher Publisher
        @param publisher The publisher object to update
        @return string containing response from the server

        Updates a pre-existing Publisher with the Publisher provided.
        """

        url_path = "/my/publishers/" + publisher.name + ".xml"
        return self.__parse_response(self.__do_http_put(url_path, publisher.to_xml()))
Esempio n. 2
0
    def create_publisher(self, publisher):
        """Create a Gnip publisher.

        @type publisher Publisher
        @param publisher A populated Publisher object
        @return string containing response from the server

        Creates a new publisher on the Gnip server, based on the
        passed in publisher object.

        """

        url_path = "/publishers"
        return self.do_http_post(url_path, publisher.to_xml())
Esempio n. 3
0
    def create_publisher(self, publisher):
        """Create a Gnip publisher in the "my" scope.

        @type publisher Publisher
        @param publisher A populated Publisher object
        @return string containing response from the server

        Creates a new publisher on the Gnip server within the "my" publisher scope.
        The publisher will be visible only to your account, and only you, can
        publish to it.
        """

        url_path = "/my/publishers"
        return self.__parse_response(self.__do_http_post(url_path, publisher.to_xml()))
Esempio n. 4
0
    def update_publisher(self, publisher):
        """Update a Gnip filter.

        @type publisher Publisher
        @param publisher The publisher object to update
        @type filter_to_update Filter
        @param filter_to_update A populated Filter object
        @return string containing response from the server

        Creates a new filter on the Gnip server, based on the
        passed in parameters.

        """

        return self.update_publisher_from_xml(publisher.name, publisher.to_xml())
Esempio n. 5
0
    def update_publisher(self, publisher):
        """Update a Gnip filter.

        @type publisher Publisher
        @param publisher The publisher object to update
        @type filter_to_update Filter
        @param filter_to_update A populated Filter object
        @return string containing response from the server

        Creates a new filter on the Gnip server, based on the
        passed in parameters.

        """

        url_path = "/my/publishers/" + publisher.name + ".xml"
        return self.__parse_response(self.__do_http_put(url_path, publisher.to_xml()))