FeedChannel

FeedChannel — a feed

Stability Level

, unless otherwise indicated

Synopsis

                    FeedChannel;
FeedChannel*        feed_channel_new                    ();
void                feed_channel_set_source             (FeedChannel *channel,
                                                         gchar *source);
const gchar*        feed_channel_get_source             (FeedChannel *channel);
void                feed_channel_set_title              (FeedChannel *channel,
                                                         gchar *title);
const gchar*        feed_channel_get_title              (FeedChannel *channel);
void                feed_channel_set_homepage           (FeedChannel *channel,
                                                         gchar *homepage);
const gchar*        feed_channel_get_homepage           (FeedChannel *channel);
void                feed_channel_set_description        (FeedChannel *channel,
                                                         gchar *description);
const gchar*        feed_channel_get_description        (FeedChannel *channel);
void                feed_channel_set_image              (FeedChannel *channel,
                                                         gchar *image);
const gchar*        feed_channel_get_image              (FeedChannel *channel);
void                feed_channel_set_icon               (FeedChannel *channel,
                                                         gchar *icon);
const gchar*        feed_channel_get_icon               (FeedChannel *channel);
void                feed_channel_set_language           (FeedChannel *channel,
                                                         gchar *language);
const gchar*        feed_channel_get_language           (FeedChannel *channel);
void                feed_channel_set_category           (FeedChannel *channel,
                                                         gchar *category);
const gchar*        feed_channel_get_category           (FeedChannel *channel);
void                feed_channel_set_pubsubhub          (FeedChannel *channel,
                                                         gchar *hub,
                                                         gchar *self);
gboolean            feed_channel_get_pubsubhub          (FeedChannel *channel,
                                                         gchar **hub,
                                                         gchar **self);
void                feed_channel_set_copyright          (FeedChannel *channel,
                                                         gchar *copyright);
const gchar*        feed_channel_get_copyright          (FeedChannel *channel);
void                feed_channel_set_editor             (FeedChannel *channel,
                                                         gchar *editor);
const gchar*        feed_channel_get_editor             (FeedChannel *channel);
void                feed_channel_add_contributor        (FeedChannel *channel,
                                                         gchar *contributor);
const GList*        feed_channel_get_contributors       (FeedChannel *channel);
void                feed_channel_set_webmaster          (FeedChannel *channel,
                                                         gchar *webmaster);
const gchar*        feed_channel_get_webmaster          (FeedChannel *channel);
void                feed_channel_set_generator          (FeedChannel *channel,
                                                         gchar *generator);
const gchar*        feed_channel_get_generator          (FeedChannel *channel);
void                feed_channel_set_publish_time       (FeedChannel *channel,
                                                         time_t publish);
time_t              feed_channel_get_publish_time       (FeedChannel *channel);
void                feed_channel_set_update_time        (FeedChannel *channel,
                                                         time_t update);
time_t              feed_channel_get_update_time        (FeedChannel *channel);
void                feed_channel_set_update_interval    (FeedChannel *channel,
                                                         int minutes);
int                 feed_channel_get_update_interval    (FeedChannel *channel);
gboolean            feed_channel_fetch                  (FeedChannel *channel);

Object Hierarchy

  GObject
   +----FeedChannel

Description

FeedChannel rappresents a single feed which may be fetched and parsed

Details

FeedChannel

typedef struct _FeedChannel FeedChannel;


feed_channel_new ()

FeedChannel*        feed_channel_new                    ();

Allocates a new FeedChannel

Returns :

a FeedChannel

feed_channel_set_source ()

void                feed_channel_set_source             (FeedChannel *channel,
                                                         gchar *source);

To assign the URL where to fetch the feed

channel :

a FeedChannel

source :

URL of the feed

feed_channel_get_source ()

const gchar*        feed_channel_get_source             (FeedChannel *channel);

Retrieves URL where to fetch the channel

channel :

a FeedChannel

Returns :

URL of the channel

feed_channel_set_title ()

void                feed_channel_set_title              (FeedChannel *channel,
                                                         gchar *title);

To set a title to the channel

channel :

a FeedChannel

title :

title of the feed

feed_channel_get_title ()

const gchar*        feed_channel_get_title              (FeedChannel *channel);

Retrieves title of the channel

channel :

a FeedChannel

Returns :

title of the feed, or NULL

feed_channel_set_homepage ()

void                feed_channel_set_homepage           (FeedChannel *channel,
                                                         gchar *homepage);

To set the homepage of the site the channel belongs

channel :

a FeedChannel

homepage :

homepage for the main website

feed_channel_get_homepage ()

const gchar*        feed_channel_get_homepage           (FeedChannel *channel);

Retrieves the homepage of the site for which channel is the feed

channel :

a FeedChannel

Returns :

reference homepage of the feed, or NULL

feed_channel_set_description ()

void                feed_channel_set_description        (FeedChannel *channel,
                                                         gchar *description);

To set the description of channel

channel :

a FeedChannel

description :

description of the feed

feed_channel_get_description ()

const gchar*        feed_channel_get_description        (FeedChannel *channel);

Retrieves the description of channel

channel :

a FeedChannel

Returns :

description of the feed, or NULL

feed_channel_set_image ()

void                feed_channel_set_image              (FeedChannel *channel,
                                                         gchar *image);

To set a rappresentative image to channel

channel :

a FeedChannel

image :

URL of the image

feed_channel_get_image ()

const gchar*        feed_channel_get_image              (FeedChannel *channel);

Retrieves the URL of the image assigned to the channel

channel :

a FeedChannel

Returns :

URL of the image, or NULL

feed_channel_set_icon ()

void                feed_channel_set_icon               (FeedChannel *channel,
                                                         gchar *icon);

To set the URL of the icon rappresenting channel

channel :

a FeedChannel

icon :

URL where to retrieve the favicon

feed_channel_get_icon ()

const gchar*        feed_channel_get_icon               (FeedChannel *channel);

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

channel :

a FeedChannel

Returns :

URL of the favicon, or NULL

feed_channel_set_language ()

void                feed_channel_set_language           (FeedChannel *channel,
                                                         gchar *language);

To set the language of channel

channel :

a FeedChannel

language :

string holding the language of the feed

feed_channel_get_language ()

const gchar*        feed_channel_get_language           (FeedChannel *channel);

Retrieves the language of the channel

channel :

a FeedChannel

Returns :

string rappresenting the language of channel

feed_channel_set_category ()

void                feed_channel_set_category           (FeedChannel *channel,
                                                         gchar *category);

To set the category of the channel

channel :

a FeedChannel

category :

category of the feed

feed_channel_get_category ()

const gchar*        feed_channel_get_category           (FeedChannel *channel);

Retrieves category of the channel

channel :

a FeedChannel

Returns :

category of the feed, or NULL

feed_channel_set_pubsubhub ()

void                feed_channel_set_pubsubhub          (FeedChannel *channel,
                                                         gchar *hub,
                                                         gchar *self);

To set information about PubSubHub for the channel. Options can be set alternatively, only with hub != NULL or self != NULL, and are saved internally to the object: the hub is considered valid (feed_channel_get_pubsubhub() returns TRUE) only when both parameters has been set. To unset the hub, pass NULL for both parameters

channel :

a FeedChannel

hub :

hub for the feed, or NULL

self :

target referencing the feed, or NULL

feed_channel_get_pubsubhub ()

gboolean            feed_channel_get_pubsubhub          (FeedChannel *channel,
                                                         gchar **hub,
                                                         gchar **self);

Retrieves information about the PubSub hub of the channel

channel :

a FeedChannel

hub :

location for the hub string, or NULL

self :

location for the reference to the feed, or NULL

Returns :

TRUE if a valid PubSub hub has been set for the channel, FALSE otherwise

feed_channel_set_copyright ()

void                feed_channel_set_copyright          (FeedChannel *channel,
                                                         gchar *copyright);

To set the copyright of the feed

channel :

a FeedChannel

copyright :

copyright of the channel

feed_channel_get_copyright ()

const gchar*        feed_channel_get_copyright          (FeedChannel *channel);

Retrieves indications about the copyright

channel :

a FeedChannel

Returns :

copyright of the channel, or NULL

feed_channel_set_editor ()

void                feed_channel_set_editor             (FeedChannel *channel,
                                                         gchar *editor);

To set the editor of the channel

channel :

a FeedChannel

editor :

editor of the feed

feed_channel_get_editor ()

const gchar*        feed_channel_get_editor             (FeedChannel *channel);

Retrieves reference to the editor or the channel

channel :

a FeedChannel

Returns :

editor of the feed, or NULL

feed_channel_add_contributor ()

void                feed_channel_add_contributor        (FeedChannel *channel,
                                                         gchar *contributor);

To add a contributor to the channel

channel :

a FeedChannel

contributor :

contributor of the feed

feed_channel_get_contributors ()

const GList*        feed_channel_get_contributors       (FeedChannel *channel);

Retrieves reference to the contributors of the channel

channel :

a FeedChannel

Returns :

list of contributors to the channel, or NULL

feed_channel_set_webmaster ()

void                feed_channel_set_webmaster          (FeedChannel *channel,
                                                         gchar *webmaster);

To assign a webmaster to the channel

channel :

a FeedChannel

webmaster :

webmaster of the feed

feed_channel_get_webmaster ()

const gchar*        feed_channel_get_webmaster          (FeedChannel *channel);

Retrieves reference to the webmaster of the feed

channel :

a FeedChannel

Returns :

webmaster of channel, or NULL

feed_channel_set_generator ()

void                feed_channel_set_generator          (FeedChannel *channel,
                                                         gchar *generator);

To set information about the software generator of channel

channel :

a FeedChannel

generator :

software generator of the feed

feed_channel_get_generator ()

const gchar*        feed_channel_get_generator          (FeedChannel *channel);

Retrieves information about the feed's software generator

channel :

a FeedChannel

Returns :

generator of channel, or NULL

feed_channel_set_publish_time ()

void                feed_channel_set_publish_time       (FeedChannel *channel,
                                                         time_t publish);

To set the time of publishing for the feed

channel :

a FeedChannel

publish :

timestamp of publishing

feed_channel_get_publish_time ()

time_t              feed_channel_get_publish_time       (FeedChannel *channel);

Retrieves the publishing time of channel

channel :

a FeedChannel

Returns :

time of feed's publish

feed_channel_set_update_time ()

void                feed_channel_set_update_time        (FeedChannel *channel,
                                                         time_t update);

To set the latest update time of channel

channel :

a FeedChannel

update :

update time of the feed

feed_channel_get_update_time ()

time_t              feed_channel_get_update_time        (FeedChannel *channel);

Retrieves the update time of channel

channel :

a FeedChannel

Returns :

time of the feed's latest update. If this value was not set (with feed_channel_set_update_time()) returns feed_channel_get_publish_time()

feed_channel_set_update_interval ()

void                feed_channel_set_update_interval    (FeedChannel *channel,
                                                         int minutes);

To set the update interval for channel

channel :

a FeedChannel

minutes :

update interval, in minutes

feed_channel_get_update_interval ()

int                 feed_channel_get_update_interval    (FeedChannel *channel);

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

channel :

a FeedChannel

Returns :

update interval for the channel, in minutes

feed_channel_fetch ()

gboolean            feed_channel_fetch                  (FeedChannel *channel);

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

channel :

a FeedChannel

Returns :

TRUE if the feed is correctly fetched and parsed, FALSE otherwise