GrssFeedChannel

GrssFeedChannel — a feed

Synopsis

struct              GrssFeedChannel;
GrssFeedChannel *   grss_feed_channel_new               ();
GrssFeedChannel *   grss_feed_channel_new_with_source   (gchar *source);
GrssFeedChannel *   grss_feed_channel_new_from_file     (const gchar *path,
                                                         GError **error);
void                grss_feed_channel_set_format        (GrssFeedChannel *channel,
                                                         gchar *format);
const gchar *       grss_feed_channel_get_format        (GrssFeedChannel *channel);
void                grss_feed_channel_set_source        (GrssFeedChannel *channel,
                                                         gchar *source);
const gchar *       grss_feed_channel_get_source        (GrssFeedChannel *channel);
void                grss_feed_channel_set_title         (GrssFeedChannel *channel,
                                                         gchar *title);
const gchar *       grss_feed_channel_get_title         (GrssFeedChannel *channel);
void                grss_feed_channel_set_homepage      (GrssFeedChannel *channel,
                                                         gchar *homepage);
const gchar *       grss_feed_channel_get_homepage      (GrssFeedChannel *channel);
void                grss_feed_channel_set_description   (GrssFeedChannel *channel,
                                                         gchar *description);
const gchar *       grss_feed_channel_get_description   (GrssFeedChannel *channel);
void                grss_feed_channel_set_image         (GrssFeedChannel *channel,
                                                         gchar *image);
const gchar *       grss_feed_channel_get_image         (GrssFeedChannel *channel);
void                grss_feed_channel_set_icon          (GrssFeedChannel *channel,
                                                         gchar *icon);
const gchar *       grss_feed_channel_get_icon          (GrssFeedChannel *channel);
void                grss_feed_channel_set_language      (GrssFeedChannel *channel,
                                                         gchar *language);
const gchar *       grss_feed_channel_get_language      (GrssFeedChannel *channel);
void                grss_feed_channel_set_category      (GrssFeedChannel *channel,
                                                         gchar *category);
const gchar *       grss_feed_channel_get_category      (GrssFeedChannel *channel);
void                grss_feed_channel_set_pubsubhub     (GrssFeedChannel *channel,
                                                         gchar *hub);
gboolean            grss_feed_channel_get_pubsubhub     (GrssFeedChannel *channel,
                                                         gchar **hub);
void                grss_feed_channel_set_rsscloud      (GrssFeedChannel *channel,
                                                         gchar *path,
                                                         gchar *protocol);
gboolean            grss_feed_channel_get_rsscloud      (GrssFeedChannel *channel,
                                                         gchar **path,
                                                         gchar **protocol);
void                grss_feed_channel_set_copyright     (GrssFeedChannel *channel,
                                                         gchar *copyright);
const gchar *       grss_feed_channel_get_copyright     (GrssFeedChannel *channel);
void                grss_feed_channel_set_editor        (GrssFeedChannel *channel,
                                                         gchar *editor);
const gchar *       grss_feed_channel_get_editor        (GrssFeedChannel *channel);
void                grss_feed_channel_add_contributor   (GrssFeedChannel *channel,
                                                         gchar *contributor);
const GList *       grss_feed_channel_get_contributors  (GrssFeedChannel *channel);
void                grss_feed_channel_set_webmaster     (GrssFeedChannel *channel,
                                                         gchar *webmaster);
const gchar *       grss_feed_channel_get_webmaster     (GrssFeedChannel *channel);
void                grss_feed_channel_set_generator     (GrssFeedChannel *channel,
                                                         gchar *generator);
const gchar *       grss_feed_channel_get_generator     (GrssFeedChannel *channel);
void                grss_feed_channel_set_publish_time  (GrssFeedChannel *channel,
                                                         time_t publish);
time_t              grss_feed_channel_get_publish_time  (GrssFeedChannel *channel);
void                grss_feed_channel_set_update_time   (GrssFeedChannel *channel,
                                                         time_t update);
time_t              grss_feed_channel_get_update_time   (GrssFeedChannel *channel);
void                grss_feed_channel_set_update_interval
                                                        (GrssFeedChannel *channel,
                                                         int minutes);
int                 grss_feed_channel_get_update_interval
                                                        (GrssFeedChannel *channel);
gboolean            grss_feed_channel_fetch             (GrssFeedChannel *channel,
                                                         GError **error);
void                grss_feed_channel_fetch_async       (GrssFeedChannel *channel,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
gboolean            grss_feed_channel_fetch_finish      (GrssFeedChannel *channel,
                                                         GAsyncResult *res,
                                                         GError **error);
GList *             grss_feed_channel_fetch_all         (GrssFeedChannel *channel,
                                                         GError **error);
void                grss_feed_channel_fetch_all_async   (GrssFeedChannel *channel,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);
GList *             grss_feed_channel_fetch_all_finish  (GrssFeedChannel *channel,
                                                         GAsyncResult *res,
                                                         GError **error);

Object Hierarchy

  GObject
   +----GrssFeedChannel

Description

GrssFeedChannel rappresents a single feed which may be fetched and parsed. It mostly is a passive container for attributes.

Details

struct GrssFeedChannel

struct GrssFeedChannel;


grss_feed_channel_new ()

GrssFeedChannel *   grss_feed_channel_new               ();

Allocates a new GrssFeedChannel.

Returns :

a GrssFeedChannel.

grss_feed_channel_new_with_source ()

GrssFeedChannel *   grss_feed_channel_new_with_source   (gchar *source);

Allocates a new GrssFeedChannel and assign it the given remote source.

source :

URL of the feed.

Returns :

a GrssFeedChannel.

grss_feed_channel_new_from_file ()

GrssFeedChannel *   grss_feed_channel_new_from_file     (const gchar *path,
                                                         GError **error);

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

path :

path of the file to parse.

error :

if an error occourred, NULL is returned and this is filled with the message.

Returns :

a GrssFeedChannel, or NULL if the file in path is not a valid document.

grss_feed_channel_set_format ()

void                grss_feed_channel_set_format        (GrssFeedChannel *channel,
                                                         gchar *format);

To assign a file format to the feed.

channel :

a GrssFeedChannel.

format :

format of the file, such as "application/atom+xml" or "application/rss+xml".

grss_feed_channel_get_format ()

const gchar *       grss_feed_channel_get_format        (GrssFeedChannel *channel);

Retrieves the file format of channel.

channel :

a GrssFeedChannel.

Returns :

file format of channel.

grss_feed_channel_set_source ()

void                grss_feed_channel_set_source        (GrssFeedChannel *channel,
                                                         gchar *source);

To assign the URL where to fetch the feed.

channel :

a GrssFeedChannel.

source :

URL of the feed.

grss_feed_channel_get_source ()

const gchar *       grss_feed_channel_get_source        (GrssFeedChannel *channel);

Retrieves URL where to fetch the channel.

channel :

a GrssFeedChannel.

Returns :

URL of the channel.

grss_feed_channel_set_title ()

void                grss_feed_channel_set_title         (GrssFeedChannel *channel,
                                                         gchar *title);

To set a title to the channel.

channel :

a GrssFeedChannel.

title :

title of the feed.

grss_feed_channel_get_title ()

const gchar *       grss_feed_channel_get_title         (GrssFeedChannel *channel);

Retrieves title of the channel.

channel :

a GrssFeedChannel.

Returns :

title of the feed, or NULL.

grss_feed_channel_set_homepage ()

void                grss_feed_channel_set_homepage      (GrssFeedChannel *channel,
                                                         gchar *homepage);

To set the homepage of the site the channel belongs.

channel :

a GrssFeedChannel.

homepage :

homepage for the main website.

grss_feed_channel_get_homepage ()

const gchar *       grss_feed_channel_get_homepage      (GrssFeedChannel *channel);

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

channel :

a GrssFeedChannel.

Returns :

reference homepage of the feed, or NULL.

grss_feed_channel_set_description ()

void                grss_feed_channel_set_description   (GrssFeedChannel *channel,
                                                         gchar *description);

To set the description of channel.

channel :

a GrssFeedChannel.

description :

description of the feed.

grss_feed_channel_get_description ()

const gchar *       grss_feed_channel_get_description   (GrssFeedChannel *channel);

Retrieves the description of channel.

channel :

a GrssFeedChannel.

Returns :

description of the feed, or NULL.

grss_feed_channel_set_image ()

void                grss_feed_channel_set_image         (GrssFeedChannel *channel,
                                                         gchar *image);

To set a rappresentative image to channel.

channel :

a GrssFeedChannel.

image :

URL of the image.

grss_feed_channel_get_image ()

const gchar *       grss_feed_channel_get_image         (GrssFeedChannel *channel);

Retrieves the URL of the image assigned to the channel.

channel :

a GrssFeedChannel.

Returns :

URL of the image, or NULL.

grss_feed_channel_set_icon ()

void                grss_feed_channel_set_icon          (GrssFeedChannel *channel,
                                                         gchar *icon);

To set the URL of the icon rappresenting channel.

channel :

a GrssFeedChannel.

icon :

URL where to retrieve the favicon.

grss_feed_channel_get_icon ()

const gchar *       grss_feed_channel_get_icon          (GrssFeedChannel *channel);

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

channel :

a GrssFeedChannel.

Returns :

URL of the favicon, or NULL.

grss_feed_channel_set_language ()

void                grss_feed_channel_set_language      (GrssFeedChannel *channel,
                                                         gchar *language);

To set the language of channel.

channel :

a GrssFeedChannel.

language :

string holding the language of the feed.

grss_feed_channel_get_language ()

const gchar *       grss_feed_channel_get_language      (GrssFeedChannel *channel);

Retrieves the language of the channel.

channel :

a GrssFeedChannel.

Returns :

string rappresenting the language of channel, or NULL.

grss_feed_channel_set_category ()

void                grss_feed_channel_set_category      (GrssFeedChannel *channel,
                                                         gchar *category);

To set the category of the channel.

channel :

a GrssFeedChannel.

category :

category of the feed.

grss_feed_channel_get_category ()

const gchar *       grss_feed_channel_get_category      (GrssFeedChannel *channel);

Retrieves category of the channel.

channel :

a GrssFeedChannel.

Returns :

category of the feed, or NULL.

grss_feed_channel_set_pubsubhub ()

void                grss_feed_channel_set_pubsubhub     (GrssFeedChannel *channel,
                                                         gchar *hub);

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

channel :

a GrssFeedChannel.

hub :

hub for the feed, or NULL.

grss_feed_channel_get_pubsubhub ()

gboolean            grss_feed_channel_get_pubsubhub     (GrssFeedChannel *channel,
                                                         gchar **hub);

Retrieves information about the PubSubHubbub hub of the channel.

channel :

a GrssFeedChannel.

hub :

location for the hub string, or NULL.

Returns :

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

grss_feed_channel_set_rsscloud ()

void                grss_feed_channel_set_rsscloud      (GrssFeedChannel *channel,
                                                         gchar *path,
                                                         gchar *protocol);

To set information about RSSCloud notifications for the channel.

channel :

a GrssFeedChannel.

path :

complete references of the URL where to register subscription, e.g. http://example.com/rsscloudNotify .

protocol :

type of protocol used for notifications.

grss_feed_channel_get_rsscloud ()

gboolean            grss_feed_channel_get_rsscloud      (GrssFeedChannel *channel,
                                                         gchar **path,
                                                         gchar **protocol);

Retrieves information about the RSSCloud coordinates of the channel.

channel :

a GrssFeedChannel.

path :

location for the path string, or NULL.

protocol :

location for the protocol string, or NULL.

Returns :

TRUE if a valid RSSCloud path has been set for the channel, FALSE otherwise.

grss_feed_channel_set_copyright ()

void                grss_feed_channel_set_copyright     (GrssFeedChannel *channel,
                                                         gchar *copyright);

To set the copyright of the feed.

channel :

a GrssFeedChannel.

copyright :

copyright of the channel.

grss_feed_channel_get_copyright ()

const gchar *       grss_feed_channel_get_copyright     (GrssFeedChannel *channel);

Retrieves indications about the copyright.

channel :

a GrssFeedChannel.

Returns :

copyright of the channel, or NULL.

grss_feed_channel_set_editor ()

void                grss_feed_channel_set_editor        (GrssFeedChannel *channel,
                                                         gchar *editor);

To set the editor of the channel.

channel :

a GrssFeedChannel.

editor :

editor of the feed.

grss_feed_channel_get_editor ()

const gchar *       grss_feed_channel_get_editor        (GrssFeedChannel *channel);

Retrieves reference to the editor or the channel.

channel :

a GrssFeedChannel.

Returns :

editor of the feed, or NULL.

grss_feed_channel_add_contributor ()

void                grss_feed_channel_add_contributor   (GrssFeedChannel *channel,
                                                         gchar *contributor);

To add a contributor to the channel.

channel :

a GrssFeedChannel.

contributor :

contributor of the feed.

grss_feed_channel_get_contributors ()

const GList *       grss_feed_channel_get_contributors  (GrssFeedChannel *channel);

Retrieves reference to the contributors of the channel.

channel :

a GrssFeedChannel.

Returns :

list of contributors to the channel, or NULL.

grss_feed_channel_set_webmaster ()

void                grss_feed_channel_set_webmaster     (GrssFeedChannel *channel,
                                                         gchar *webmaster);

To assign a webmaster to the channel.

channel :

a GrssFeedChannel.

webmaster :

webmaster of the feed.

grss_feed_channel_get_webmaster ()

const gchar *       grss_feed_channel_get_webmaster     (GrssFeedChannel *channel);

Retrieves reference to the webmaster of the feed.

channel :

a GrssFeedChannel.

Returns :

webmaster of channel, or NULL.

grss_feed_channel_set_generator ()

void                grss_feed_channel_set_generator     (GrssFeedChannel *channel,
                                                         gchar *generator);

To set information about the software generator of channel.

channel :

a GrssFeedChannel.

generator :

software generator of the feed.

grss_feed_channel_get_generator ()

const gchar *       grss_feed_channel_get_generator     (GrssFeedChannel *channel);

Retrieves information about the feed's software generator.

channel :

a GrssFeedChannel.

Returns :

generator of channel, or NULL.

grss_feed_channel_set_publish_time ()

void                grss_feed_channel_set_publish_time  (GrssFeedChannel *channel,
                                                         time_t publish);

To set the time of publishing for the feed.

channel :

a GrssFeedChannel.

publish :

timestamp of publishing.

grss_feed_channel_get_publish_time ()

time_t              grss_feed_channel_get_publish_time  (GrssFeedChannel *channel);

Retrieves the publishing time of channel.

channel :

a GrssFeedChannel.

Returns :

time of feed's publish.

grss_feed_channel_set_update_time ()

void                grss_feed_channel_set_update_time   (GrssFeedChannel *channel,
                                                         time_t update);

To set the latest update time of channel.

channel :

a GrssFeedChannel.

update :

update time of the feed.

grss_feed_channel_get_update_time ()

time_t              grss_feed_channel_get_update_time   (GrssFeedChannel *channel);

Retrieves the update time of channel.

channel :

a GrssFeedChannel.

Returns :

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

grss_feed_channel_set_update_interval ()

void                grss_feed_channel_set_update_interval
                                                        (GrssFeedChannel *channel,
                                                         int minutes);

To set the update interval for channel.

channel :

a GrssFeedChannel.

minutes :

update interval, in minutes.

grss_feed_channel_get_update_interval ()

int                 grss_feed_channel_get_update_interval
                                                        (GrssFeedChannel *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 grss_feed_channel_set_update_interval().

channel :

a GrssFeedChannel.

Returns :

update interval for the channel, in minutes.

grss_feed_channel_fetch ()

gboolean            grss_feed_channel_fetch             (GrssFeedChannel *channel,
                                                         GError **error);

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

channel :

a GrssFeedChannel.

error :

if an error occourred, FALSE is returned and this is filled with the message.

Returns :

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

grss_feed_channel_fetch_async ()

void                grss_feed_channel_fetch_async       (GrssFeedChannel *channel,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

Similar to grss_feed_channel_fetch(), but asyncronous.

channel :

a GrssFeedChannel.

callback :

function to invoke at the end of the download.

user_data :

data passed to the callback.

grss_feed_channel_fetch_finish ()

gboolean            grss_feed_channel_fetch_finish      (GrssFeedChannel *channel,
                                                         GAsyncResult *res,
                                                         GError **error);

Finalizes an asyncronous operation started with grss_feed_channel_fetch_async().

channel :

a GrssFeedChannel.

res :

the GAsyncResult passed to the callback.

error :

if an error occourred, FALSE is returned and this is filled with the message.

Returns :

TRUE if channel informations have been successfully fetched, FALSE otherwise.

grss_feed_channel_fetch_all ()

GList *             grss_feed_channel_fetch_all         (GrssFeedChannel *channel,
                                                         GError **error);

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

channel :

a GrssFeedChannel.

error :

if an error occourred, NULL is returned and this is filled with the message.

Returns :

a GList of GrssFeedItem, to be completely unreferenced and freed when no longer in use, or NULL if an error occurs.

grss_feed_channel_fetch_all_async ()

void                grss_feed_channel_fetch_all_async   (GrssFeedChannel *channel,
                                                         GAsyncReadyCallback callback,
                                                         gpointer user_data);

Similar to grss_feed_channel_fetch_all(), but asyncronous.

channel :

a GrssFeedChannel.

callback :

function to invoke at the end of the download.

user_data :

data passed to the callback.

grss_feed_channel_fetch_all_finish ()

GList *             grss_feed_channel_fetch_all_finish  (GrssFeedChannel *channel,
                                                         GAsyncResult *res,
                                                         GError **error);

Finalizes an asyncronous operation started with grss_feed_channel_fetch_all_async().

channel :

a GrssFeedChannel.

res :

the GAsyncResult passed to the callback.

error :

if an error occourred, NULL is returned and this is filled with the message.

Returns :

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