![]() |
![]() |
![]() |
libgrss Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
FeedItem; FeedItem* feed_item_new (FeedChannel *parent
); FeedChannel* feed_item_get_parent (FeedItem *item
); void feed_item_set_id (FeedItem *item
,gchar *id
); const gchar* feed_item_get_id (FeedItem *item
); void feed_item_set_title (FeedItem *item
,gchar *title
); const gchar* feed_item_get_title (FeedItem *item
); void feed_item_set_description (FeedItem *item
,gchar *description
); const gchar* feed_item_get_description (FeedItem *item
); void feed_item_add_category (FeedItem *item
,gchar *category
); const GList* feed_item_get_categories (FeedItem *item
); void feed_item_set_source (FeedItem *item
,gchar *source
); const gchar* feed_item_get_source (FeedItem *item
); void feed_item_set_real_source (FeedItem *item
,gchar *realsource
,gchar *title
); void feed_item_get_real_source (FeedItem *item
,const gchar **realsource
,const gchar **title
); void feed_item_set_related (FeedItem *item
,gchar *related
); const gchar* feed_item_get_related (FeedItem *item
); void feed_item_set_copyright (FeedItem *item
,gchar *copyright
); const gchar* feed_item_get_copyright (FeedItem *item
); void feed_item_set_author (FeedItem *item
,gchar *author
); const gchar* feed_item_get_author (FeedItem *item
); void feed_item_add_contributor (FeedItem *item
,gchar *contributor
); const GList* feed_item_get_contributors (FeedItem *item
); void feed_item_set_comments_url (FeedItem *item
,gchar *url
); const gchar* feed_item_get_comments_url (FeedItem *item
); void feed_item_set_geo_point (FeedItem *item
,double latitude
,double longitude
); gboolean feed_item_get_geo_point (FeedItem *item
,double *latitude
,double *longitude
); void feed_item_set_publish_time (FeedItem *item
,time_t publish
); time_t feed_item_get_publish_time (FeedItem *item
); void feed_item_add_enclosure (FeedItem *item
,FeedEnclosure *enclosure
); const GList* feed_item_get_enclosures (FeedItem *item
);
FeedItem is an abstraction for an item, collects all information about a single element found into a feed
FeedItem* feed_item_new (FeedChannel *parent
);
To allocate a new empty FeedItem
|
the feed from which the new item belongs |
Returns : |
a new FeedItem |
FeedChannel* feed_item_get_parent (FeedItem *item
);
Retrieves the feed from which the item belongs
|
a FeedItem |
Returns : |
the parent feed, as set in feed_item_new()
|
void feed_item_set_id (FeedItem *item
,gchar *id
);
To set the ID of the item
. This parameter has not a particular format: it
is just a string used to identify in unique way the item
|
a FeedItem |
|
the new ID to set |
const gchar* feed_item_get_id (FeedItem *item
);
Retrieves the ID assigned to the item
. If no ID was set with
feed_item_set_id()
this returns the same of feed_item_get_source()
.
Pay attention to the fact this library do not check uniqueness of assigned
IDs
|
FeedItem from which retrieve the ID |
Returns : |
ID of the item |
void feed_item_set_title (FeedItem *item
,gchar *title
);
To set a title to the item
|
a FeedItem |
|
title of the item |
const gchar* feed_item_get_title (FeedItem *item
);
Retrieves the title assigned to item
|
a FeedItem |
Returns : |
title of the element |
void feed_item_set_description (FeedItem *item
,gchar *description
);
To set the description of item
. Usually "description" means his content
|
a FeedItem |
|
content of the item |
const gchar* feed_item_get_description (FeedItem *item
);
Retrieves the description of the item
|
a FeedItem |
Returns : |
description of item
|
void feed_item_add_category (FeedItem *item
,gchar *category
);
Adds a category to the item
. The complete list can be obtained with
feed_item_get_categories()
|
a FeedItem |
|
a new category to assign to the item |
const GList* feed_item_get_categories (FeedItem *item
);
Retrieves list of categories assigned to the item
|
a FeedItem |
Returns : |
list of strings, one for assigned category. Do not free or modify this list |
void feed_item_set_source (FeedItem *item
,gchar *source
);
To set the source of the item
|
a FeedItem |
|
URL of the item |
const gchar* feed_item_get_source (FeedItem *item
);
Retrieves the URL where the item
can be found
|
a FeedItem |
Returns : |
URL of the item, or NULL |
void feed_item_set_real_source (FeedItem *item
,gchar *realsource
,gchar *title
);
To set an alternative real source for item
. This parameter is used by web
aggregators to explicit the origin of a content reproduced in them
|
a FeedItem |
|
URL of the real source for the item |
|
title of the real source |
void feed_item_get_real_source (FeedItem *item
,const gchar **realsource
,const gchar **title
);
Retrieves references to the real source of item
|
a FeedItem |
|
will be assigned to the URL of the real source, or NULL |
|
will be assigned to the title of the real source, or NULL |
void feed_item_set_related (FeedItem *item
,gchar *related
);
To set reference to a post related to item
|
a FeedItem |
|
reference to a related post |
const gchar* feed_item_get_related (FeedItem *item
);
Retrieves indication about posts related to item
|
a FeedItem |
Returns : |
related posts, or NULL |
void feed_item_set_copyright (FeedItem *item
,gchar *copyright
);
To set a copyright reference to item
|
a FeedItem |
|
copyright declaration for the item |
const gchar* feed_item_get_copyright (FeedItem *item
);
Retrieves copyright reference for the item
|
a FeedItem |
Returns : |
copyright mark, or NULL |
void feed_item_set_author (FeedItem *item
,gchar *author
);
To assign an author to the item
|
a FeedItem |
|
name of the author |
const gchar* feed_item_get_author (FeedItem *item
);
Retrieves the author of item
|
a FeedItem |
Returns : |
author of the item, or NULL |
void feed_item_add_contributor (FeedItem *item
,gchar *contributor
);
To add a contributor to the item
|
a FeedItem |
|
name of the contributor for the item |
const GList* feed_item_get_contributors (FeedItem *item
);
Retrieves contributors for item
|
a FeedItem |
Returns : |
list of contributors to the item |
void feed_item_set_comments_url (FeedItem *item
,gchar *url
);
To assign the URL where to fetch comments for the item
|
a FeedItem |
|
URL where to retrieve comments to the item |
const gchar* feed_item_get_comments_url (FeedItem *item
);
Retrieves the URL where to catch comments to the item
|
a FeedItem |
Returns : |
URL to parse to read comments for item , or NULL
|
void feed_item_set_geo_point (FeedItem *item
,double latitude
,double longitude
);
To assign geographic context to the item
.
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
|
a FeedItem |
|
latitude of the point, or -1 to leave the previous one |
|
longitude of the point, or -1 to leave the previous one |
gboolean feed_item_get_geo_point (FeedItem *item
,double *latitude
,double *longitude
);
Retrieves the geo reference of the item
|
a FeedItem |
|
will be assigned to the latitude of the point, or NULL |
|
will be assigned to the longitude of the point, or NULL |
Returns : |
TRUE if item has geographic coordinates assigned and
latitude and longitude have been set, FALSE if item has not geo
reference
|
void feed_item_set_publish_time (FeedItem *item
,time_t publish
);
To set the publish time of the item
|
a FeedItem |
|
publishing timestamp of the item |
time_t feed_item_get_publish_time (FeedItem *item
);
Retrieves the publish time of the item. By default this value is the
current timestamp assigned when creating the FeedItem, and may be changed
with feed_item_set_publish_time()
|
a FeedItem |
Returns : |
publish time of item
|
void feed_item_add_enclosure (FeedItem *item
,FeedEnclosure *enclosure
);
Adds an enclosure to the item
. That external elements may be references
to images, videos, or other contents (usually multimedial) embedded in the
element
|
a FeedItem |
|
a FeedEnclosure to add to the item |
const GList* feed_item_get_enclosures (FeedItem *item
);
Retrieves the list of enclosures added with feed_item_add_enclosure()
|
a FeedItem |
Returns : |
a list of FeedEnclosure. This is a direct reference to the internal list, do not free or modify it |