Grss.FeedItem

g GObject.Object GObject.Object Grss.FeedItem Grss.FeedItem GObject.Object->Grss.FeedItem

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (parent)

add_category (category)

add_contributor (contributor)

add_enclosure (enclosure)

get_author ()

get_categories ()

get_comments_url ()

get_contributors ()

get_copyright ()

get_description ()

get_enclosures ()

get_geo_point (latitude, longitude)

get_id ()

get_parent ()

get_publish_time ()

get_real_source (realsource, title)

get_related ()

get_source ()

get_title ()

set_author (author)

set_comments_url (url)

set_copyright (copyright)

set_description (description)

set_geo_point (latitude, longitude)

set_id (id)

set_publish_time (publish)

set_real_source (realsource, title)

set_related (related)

set_source (source)

set_title (title)

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.FeedItem(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Grss.FeedItemClass

classmethod new(parent)
Parameters:

parent (Grss.FeedChannel) – the feed from which the new item belongs.

Returns:

a new Grss.FeedItem.

Return type:

Grss.FeedItem

To allocate a new empty Grss.FeedItem.

add_category(category)
Parameters:

category (str) – a new category to assign to the item.

Adds a category to the self. The complete list can be obtained with Grss.FeedItem.get_categories().

add_contributor(contributor)
Parameters:

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

To add a contributor to the self.

add_enclosure(enclosure)
Parameters:

enclosure (Grss.FeedEnclosure) – a Grss.FeedEnclosure to add to the item.

Adds an enclosure to the self. That external elements may be references to images, videos, or other contents (usually multimedial) embedded in the element.

get_author()
Returns:

Grss.Person, or None.

Return type:

Grss.Person

Retrieves the author of self.

get_categories()
Returns:

list of strings, one for assigned category. Do not free or modify this list.

Return type:

[str]

Retrieves list of categories assigned to the self.

get_comments_url()
Returns:

URL to parse to read comments for self, or None.

Return type:

str

Retrieves the URL where to catch comments to the self.

get_contributors()
Returns:

list of contributors to the item.

Return type:

[Grss.Person]

Retrieves contributors for self.

Returns:

copyright mark, or None.

Return type:

str

Retrieves copyright reference for the self.

get_description()
Returns:

description of self.

Return type:

str

Retrieves the description of the self.

get_enclosures()
Returns:

a list of Grss.FeedEnclosure. This is a direct reference to the internal list, do not free or modify it.

Return type:

[Grss.FeedEnclosure]

Retrieves the list of enclosures added with Grss.FeedItem.add_enclosure().

get_geo_point(latitude, longitude)
Parameters:
  • latitude (float) – will be assigned to the latitude of the point, or None.

  • longitude (float) – will be assigned to the longitude of the point, or None.

Returns:

True if self has geographic coordinates assigned and latitude and longitude have been set, False if self has not geo reference.

Return type:

bool

Retrieves the geo reference of the self.

get_id()
Returns:

ID of the item.

Return type:

str

Retrieves the ID assigned to the self. If no ID was set with Grss.FeedItem.set_id() this returns the same of Grss.FeedItem.get_source(). Pay attention to the fact this library do not check uniqueness of assigned IDs.

get_parent()
Returns:

the parent feed, as set in Grss.FeedItem.new().

Return type:

Grss.FeedChannel

Retrieves the feed from which the item belongs.

get_publish_time()
Returns:

publish time of self.

Return type:

int

Retrieves the publish time of the item. By default this value is the current timestamp assigned when creating the Grss.FeedItem, and may be changed with Grss.FeedItem.set_publish_time().

get_real_source(realsource, title)
Parameters:
  • realsource (str) – will be assigned to the URL of the real source, or None.

  • title (str) – will be assigned to the title of the real source, or None.

Retrieves references to the real source of self.

Returns:

related posts, or None.

Return type:

str

Retrieves indication about posts related to self.

get_source()
Returns:

URL of the item, or None.

Return type:

str

Retrieves the URL where the self can be found.

get_title()
Returns:

title of the element.

Return type:

str

Retrieves the title assigned to self.

set_author(author)
Parameters:

author (Grss.Person) – a Grss.Person.

To assign an author to the self.

set_comments_url(url)
Parameters:

url (str) – URL where to retrieve comments to the item.

Returns:

True if url is a valid URL, False otherwise

Return type:

bool

To assign the URL where to fetch comments for the item.

Parameters:

copyright (str) – copyright declaration for the item.

To set a copyright reference to self.

set_description(description)
Parameters:

description (str) – content of the item.

To set the description of self. Usually “description” means his content.

set_geo_point(latitude, longitude)
Parameters:
  • latitude (float) – latitude of the point, or -1 to leave the previous one.

  • longitude (float) – longitude of the point, or -1 to leave the previous one.

To assign geographic context to the self. Passing -1 as latitude or longitude, the relative value is untouched in the object. This is to easy assignment of coordinates in more than a single step. If both are -1, nothing happens.

set_id(id)
Parameters:

id (str) – the new ID to set.

To set the ID of the self. This parameter has not a particular format: it is just a string used to identify in unique way the item.

set_publish_time(publish)
Parameters:

publish (int) – publishing timestamp of the item.

To set the publish time of the item.

set_real_source(realsource, title)
Parameters:
  • realsource (str) – URL of the real source for the item.

  • title (str) – title of the real source.

Returns:

True if realsource is a valid URL, False otherwise

Return type:

bool

To set an alternative real source for self. This parameter is used by web aggregators to explicit the origin of a content reproduced in them.

Parameters:

related (str) – reference to a related post.

To set reference to a post related to self.

set_source(source)
Parameters:

source (str) – URL of the item.

Returns:

True if source is a valid URL, False otherwise

Return type:

bool

To set the source of the self.

set_title(title)
Parameters:

title (str) – title of the item.

To set a title to the self.