FeedItem

FeedItem — a feed item

Stability Level

, unless otherwise indicated

Synopsis

                    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);

Object Hierarchy

  GObject
   +----FeedItem

Description

FeedItem is an abstraction for an item, collects all informations about a single element found into a feed

Details

FeedItem

typedef struct _FeedItem FeedItem;


feed_item_new ()

FeedItem*           feed_item_new                       (FeedChannel *parent);

To allocate a new empty FeedItem

parent :

the feed from which the new item belongs

Returns :

a new FeedItem

feed_item_get_parent ()

FeedChannel*        feed_item_get_parent                (FeedItem *item);

Retrieves the feed from which the item belongs

item :

a FeedItem

Returns :

the parent feed, as set in feed_item_new()

feed_item_set_id ()

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

item :

a FeedItem

id :

the new ID to set

feed_item_get_id ()

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

item :

FeedItem from which retrieve the ID

Returns :

ID of the item

feed_item_set_title ()

void                feed_item_set_title                 (FeedItem *item,
                                                         gchar *title);

To set a title to the item

item :

a FeedItem

title :

title of the item

feed_item_get_title ()

const gchar*        feed_item_get_title                 (FeedItem *item);

Retrieves the title assigned to item

item :

a FeedItem

Returns :

title of the element

feed_item_set_description ()

void                feed_item_set_description           (FeedItem *item,
                                                         gchar *description);

To set the description of item. Usually "description" means his content

item :

a FeedItem

description :

content of the item

feed_item_get_description ()

const gchar*        feed_item_get_description           (FeedItem *item);

Retrieves the description of the item

item :

a FeedItem

Returns :

description of item

feed_item_add_category ()

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()

item :

a FeedItem

category :

a new category to assign to the item

feed_item_get_categories ()

const GList*        feed_item_get_categories            (FeedItem *item);

Retrieves list of categories assigned to the item

item :

a FeedItem

Returns :

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

feed_item_set_source ()

void                feed_item_set_source                (FeedItem *item,
                                                         gchar *source);

To set the source of the item

item :

a FeedItem

source :

URL of the item

feed_item_get_source ()

const gchar*        feed_item_get_source                (FeedItem *item);

Retrieves the URL where the item can be found

item :

a FeedItem

Returns :

URL of the item, or NULL

feed_item_set_real_source ()

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

item :

a FeedItem

realsource :

URL of the real source for the item

title :

title of the real source

feed_item_get_real_source ()

void                feed_item_get_real_source           (FeedItem *item,
                                                         const gchar **realsource,
                                                         const gchar **title);

Retrieves references to the real source of item

item :

a FeedItem

realsource :

will be assigned to the URL of the real source, or NULL

title :

will be assigned to the title of the real source, or NULL

feed_item_set_related ()

void                feed_item_set_related               (FeedItem *item,
                                                         gchar *related);

To set reference to a post related to item

item :

a FeedItem

related :

reference to a related post

feed_item_get_related ()

const gchar*        feed_item_get_related               (FeedItem *item);

Retrieves indication about posts related to item

item :

a FeedItem

Returns :

related posts, or NULL

feed_item_set_copyright ()

void                feed_item_set_copyright             (FeedItem *item,
                                                         gchar *copyright);

To set a copyright reference to item

item :

a FeedItem

copyright :

copyright declaration for the item

feed_item_get_copyright ()

const gchar*        feed_item_get_copyright             (FeedItem *item);

Retrieves copyright reference for the item

item :

a FeedItem

Returns :

copyright mark, or NULL

feed_item_set_author ()

void                feed_item_set_author                (FeedItem *item,
                                                         gchar *author);

To assign an author to the item

item :

a FeedItem

author :

name of the author

feed_item_get_author ()

const gchar*        feed_item_get_author                (FeedItem *item);

Retrieves the author of item

item :

a FeedItem

Returns :

author of the item, or NULL

feed_item_add_contributor ()

void                feed_item_add_contributor           (FeedItem *item,
                                                         gchar *contributor);

To add a contributor to the item

item :

a FeedItem

contributor :

name of the contributor for the item

feed_item_get_contributors ()

const GList*        feed_item_get_contributors          (FeedItem *item);

Retrieves contributors for item

item :

a FeedItem

Returns :

list of contributors to the item

feed_item_set_comments_url ()

void                feed_item_set_comments_url          (FeedItem *item,
                                                         gchar *url);

To assign the URL where to fetch comments for the item

item :

a FeedItem

url :

URL where to retrieve comments to the item

feed_item_get_comments_url ()

const gchar*        feed_item_get_comments_url          (FeedItem *item);

Retrieves the URL where to catch comments to the item

item :

a FeedItem

Returns :

URL to parse to read comments for item, or NULL

feed_item_set_geo_point ()

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

item :

a FeedItem

latitude :

latitude of the point, or -1 to leave the previous one

longitude :

longitude of the point, or -1 to leave the previous one

feed_item_get_geo_point ()

gboolean            feed_item_get_geo_point             (FeedItem *item,
                                                         double *latitude,
                                                         double *longitude);

Retrieves the geo reference of the item

item :

a FeedItem

latitude :

will be assigned to the latitude of the point, or NULL

longitude :

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

feed_item_set_publish_time ()

void                feed_item_set_publish_time          (FeedItem *item,
                                                         time_t publish);

To set the publish time of the item

item :

a FeedItem

publish :

publishing timestamp of the item

feed_item_get_publish_time ()

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()

item :

a FeedItem

Returns :

publish time of item

feed_item_add_enclosure ()

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

item :

a FeedItem

enclosure :

a FeedEnclosure to add to the item

feed_item_get_enclosures ()

const GList*        feed_item_get_enclosures            (FeedItem *item);

Retrieves the list of enclosures added with feed_item_add_enclosure()

item :

a FeedItem

Returns :

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