Grss.FeedChannel

g GObject.Object GObject.Object Grss.FeedChannel Grss.FeedChannel GObject.Object->Grss.FeedChannel

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

class

new_from_file (path)

class

new_from_memory (data)

class

new_from_xml (doc)

class

new_with_source (source)

add_contributor (contributor)

add_cookie (cookie)

fetch ()

fetch_all ()

fetch_all_async (callback, *user_data)

fetch_all_finish (res)

fetch_async (callback, *user_data)

fetch_cancel ()

fetch_finish (res)

get_category ()

get_contributors ()

get_cookies ()

get_copyright ()

get_description ()

get_editor ()

get_format ()

get_generator ()

get_gzip_compression ()

get_homepage ()

get_icon ()

get_image ()

get_language ()

get_publish_time ()

get_pubsubhub (hub)

get_rsscloud (path, protocol)

get_source ()

get_title ()

get_update_interval ()

get_update_time ()

get_webmaster ()

set_category (category)

set_copyright (copyright)

set_description (description)

set_editor (editor)

set_format (format)

set_generator (generator)

set_gzip_compression (value)

set_homepage (homepage)

set_icon (icon)

set_image (image)

set_language (language)

set_publish_time (publish)

set_pubsubhub (hub)

set_rsscloud (path, protocol)

set_source (source)

set_title (title)

set_update_interval (minutes)

set_update_time (update)

set_webmaster (webmaster)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Grss.FeedChannel(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Grss.FeedChannelClass

classmethod new()
Returns:

a Grss.FeedChannel.

Return type:

Grss.FeedChannel

Allocates a new Grss.FeedChannel.

classmethod new_from_file(path)
Parameters:

path (str) – path of the file to parse.

Raises:

GLib.Error

Returns:

a Grss.FeedChannel, or None if the file in path is not a valid document.

Return type:

Grss.FeedChannel

Allocates a new Grss.FeedChannel and init it with contents found in specified file.

classmethod new_from_memory(data)
Parameters:

data (str) – string to parse.

Raises:

GLib.Error

Returns:

a Grss.FeedChannel, or None if an error occurs.

Return type:

Grss.FeedChannel

Allocates a new Grss.FeedChannel and init it with contents found in specified memory block.

classmethod new_from_xml(doc)
Parameters:

doc (libxml2.DocPtr) – an XML document previously parsed with libxml2.

Raises:

GLib.Error

Returns:

a Grss.FeedChannel, or None if an error occurs.

Return type:

Grss.FeedChannel

Allocates a new Grss.FeedChannel and init it with contents found in specified XML document.

classmethod new_with_source(source)
Parameters:

source (str) – URL of the feed.

Returns:

a Grss.FeedChannel.

Return type:

Grss.FeedChannel

Allocates a new Grss.FeedChannel and assign it the given remote source.

add_contributor(contributor)
Parameters:

contributor (Grss.Person) – a Grss.Person.

To add a contributor to the self.

Parameters:

cookie (Soup.Cookie) – HTML cookie to add to the Grss.FeedChannel's cookie jar

To add a cookie related to the self, will be involved in HTTP sessions while fetching it. More cookie can be added to every Grss.FeedChannel

fetch()
Raises:

GLib.Error

Returns:

True if the feed is correctly fetched and parsed, False otherwise.

Return type:

bool

Utility to fetch and populate a Grss.FeedChannel for the first time, and init all his internal values. Only the source URL has to be set in self (with Grss.FeedChannel.set_source()). Be aware this function is sync, do not returns until the feed isn’t downloaded and parsed.

fetch_all()
Raises:

GLib.Error

Returns:

a GLib.List of Grss.FeedItem, to be completely unreferenced and freed when no longer in use, or None if an error occurs.

Return type:

[Grss.FeedItem]

Utility to fetch and populate a Grss.FeedChannel, and retrieve all its items.

fetch_all_async(callback, *user_data)
Parameters:

Similar to Grss.FeedChannel.fetch_all(), but asyncronous.

fetch_all_finish(res)
Parameters:

res (Gio.AsyncResult) – the Gio.AsyncResult passed to the callback.

Raises:

GLib.Error

Returns:

list of items fetched from the Grss.FeedChannel, or None if error is set. The list (and contained items) is freed at the end of the callback

Return type:

[Grss.FeedItem]

Finalizes an asyncronous operation started with Grss.FeedChannel.fetch_all_async().

fetch_async(callback, *user_data)
Parameters:

Similar to Grss.FeedChannel.fetch(), but asyncronous.

fetch_cancel()
Returns:

True if a fetch was scheduled (and now cancelled), False if this function had nothing to do

Return type:

bool

If a fetch operation was scheduled with Grss.FeedChannel.fetch_async() or Grss.FeedChannel.fetch_all_async(), cancel it.

fetch_finish(res)
Parameters:

res (Gio.AsyncResult) – the Gio.AsyncResult passed to the callback.

Raises:

GLib.Error

Returns:

True if self informations have been successfully fetched, False otherwise.

Return type:

bool

Finalizes an asyncronous operation started with Grss.FeedChannel.fetch_async().

get_category()
Returns:

category of the feed, or None.

Return type:

str

Retrieves category of the self.

get_contributors()
Returns:

list of contributors to the channel, or None.

Return type:

[Grss.Person]

Retrieves reference to the contributors of the self.

get_cookies()
Returns:

list of cookies to the channel, or None.

Return type:

[Soup.Cookie]

Retrieves reference to the HTML cookies of the self. The list and the individual cookies should all be freed after use. You can use soup_cookies_free.

Returns:

copyright of the self, or None.

Return type:

str

Retrieves indications about the copyright.

get_description()
Returns:

description of the feed, or None.

Return type:

str

Retrieves the description of self.

get_editor()
Returns:

Grss.Person, or None.

Return type:

Grss.Person

Retrieves reference to the editor or the self.

get_format()
Returns:

file format of channel.

Return type:

str

Retrieves the file format of self.

get_generator()
Returns:

generator of self, or None.

Return type:

str

Retrieves information about the feed’s software generator.

get_gzip_compression()
Returns:

True if self has GZIP compression on.

Return type:

bool

GZIP compression of the channel is either on or off.

get_homepage()
Returns:

reference homepage of the feed, or None.

Return type:

str

Retrieves the homepage of the site for which self is the feed.

get_icon()
Returns:

URL of the favicon, or None.

Return type:

str

Retrieves URL of the favicon of the channel (and/or the website for which this is the feed).

get_image()
Returns:

URL of the image, or None.

Return type:

str

Retrieves the URL of the image assigned to the channel.

get_language()
Returns:

string rappresenting the language of channel, or None.

Return type:

str

Retrieves the language of the self.

get_publish_time()
Returns:

time of feed’s publish.

Return type:

int

Retrieves the publishing time of self.

get_pubsubhub(hub)
Parameters:

hub (str) – location for the hub string, or None.

Returns:

True if a valid PubSubHubbub hub has been set for the self, False otherwise.

Return type:

bool

Retrieves information about the PubSubHubbub hub of the channel.

get_rsscloud(path, protocol)
Parameters:
  • path (str) – location for the path string, or None.

  • protocol (str) – location for the protocol string, or None.

Returns:

True if a valid RSSCloud path has been set for the self, False otherwise.

Return type:

bool

Retrieves information about the RSSCloud coordinates of the channel.

get_source()
Returns:

URL of the channel.

Return type:

str

Retrieves URL where to fetch the self.

get_title()
Returns:

title of the feed, or None.

Return type:

str

Retrieves title of the self.

get_update_interval()
Returns:

update interval for the self, in minutes.

Return type:

int

Retrieves the update interval for the feed. Pay attention to the fact the value can be unset, and the function returns 0: in this case the caller must manually set a default update interval with Grss.FeedChannel.set_update_interval().

get_update_time()
Returns:

time of the feed’s latest update. If this value was not set (with Grss.FeedChannel.set_update_time()) returns Grss.FeedChannel.get_publish_time().

Return type:

int

Retrieves the update time of self.

get_webmaster()
Returns:

webmaster of self, or None.

Return type:

str

Retrieves reference to the webmaster of the feed.

set_category(category)
Parameters:

category (str) – category of the feed.

To set the category of the self.

Parameters:

copyright (str) – copyright of the channel.

To set the copyright of the feed.

set_description(description)
Parameters:

description (str) – description of the feed.

To set the description of self.

set_editor(editor)
Parameters:

editor (Grss.Person) – a Grss.Person.

To set the editor of the self.

set_format(format)
Parameters:

format (str) – format of the file, such as “application/atom+xml” or “application/rss+xml”.

To assign a file format to the feed.

set_generator(generator)
Parameters:

generator (str) – software generator of the feed.

To set information about the software generator of self.

set_gzip_compression(value)
Parameters:

value (bool) – True to enable GZIP compression when fetching the channel

Set the GZIP compression for the channel to on or off.

set_homepage(homepage)
Parameters:

homepage (str) – homepage for the main website.

Returns:

True if homepage is a valid URL, False otherwise

Return type:

bool

To set the homepage of the site the self belongs.

set_icon(icon)
Parameters:

icon (str) – URL where to retrieve the favicon.

Returns:

True if icon is a valid URL, False otherwise

Return type:

bool

To set the URL of the icon rappresenting self.

set_image(image)
Parameters:

image (str) – URL of the image.

Returns:

True if image is a valid URL, False otherwise

Return type:

bool

To set a rappresentative image to self.

set_language(language)
Parameters:

language (str) – string holding the language of the feed.

To set the language of self.

set_publish_time(publish)
Parameters:

publish (int) – timestamp of publishing.

To set the time of publishing for the feed.

set_pubsubhub(hub)
Parameters:

hub (str) – hub for the feed, or None.

Returns:

True if hub is a valid URL, False otherwise

Return type:

bool

To set information about PubSubHubbub for the channel. To unset the hub, pass None as parameter.

set_rsscloud(path, protocol)
Parameters:
  • path (str) – complete references of the URL where to register subscription, e.g. http://example.com/rsscloudNotify .

  • protocol (str) – type of protocol used for notifications.

To set information about RSSCloud notifications for the channel.

set_source(source)
Parameters:

source (str) – URL of the feed.

Returns:

True if source is a valid URL, False otherwise

Return type:

bool

To assign the URL where to fetch the feed.

set_title(title)
Parameters:

title (str) – title of the feed.

To set a title to the self.

set_update_interval(minutes)
Parameters:

minutes (int) – update interval, in minutes.

To set the update interval for self.

set_update_time(update)
Parameters:

update (int) – update time of the feed.

To set the latest update time of self.

set_webmaster(webmaster)
Parameters:

webmaster (str) – webmaster of the feed.

To assign a webmaster to the self.