![]() |
![]() |
![]() |
libgrss Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
struct GrssFeedsPublisher; GrssFeedsPublisher * grss_feeds_publisher_new (); gchar * grss_feeds_publisher_format_content (GrssFeedsPublisher *pub
,GrssFeedChannel *channel
,GList *items
,GError **error
); gboolean grss_feeds_publisher_publish_web (GrssFeedsPublisher *pub
,GrssFeedChannel *channel
,GList *items
,const gchar *id
,GError **error
); gboolean grss_feeds_publisher_publish_file (GrssFeedsPublisher *pub
,GrssFeedChannel *channel
,GList *items
,const gchar *uri
,GError **error
); void grss_feeds_publisher_hub_set_port (GrssFeedsPublisher *pub
,int port
); void grss_feeds_publisher_hub_set_topics (GrssFeedsPublisher *pub
,GList *topics
); void grss_feeds_publisher_hub_switch (GrssFeedsPublisher *pub
,gboolean run
);
GrssFeedsPublisher may be used to expose contents for any given GrssFeedChannel, both writing a file to be dispatched by the local webserver or providing himself to distribute it, and implements a server able to receive subscriptions by PubSubHubbub clients and deliver them new contents in real-time.
GrssFeedsPublisher * grss_feeds_publisher_new ();
Allocates a new GrssFeedsPublisher.
Returns : |
a new GrssFeedsPublisher. |
gchar * grss_feeds_publisher_format_content (GrssFeedsPublisher *pub
,GrssFeedChannel *channel
,GList *items
,GError **error
);
Format a GrssFeedChannel in Atom and returns the resulting string.
|
a GrssFeedsPublisher. |
|
the GrssFeedChannel to dump in the file. |
|
list of GrssFeedItems to be added in the feed. |
|
if an error occourred, NULL is returned and this is filled with the
message. |
Returns : |
a newly allocated string holding the formatted feed, to be freed when no longer in use. |
gboolean grss_feeds_publisher_publish_web (GrssFeedsPublisher *pub
,GrssFeedChannel *channel
,GList *items
,const gchar *id
,GError **error
);
If the local web server has been executed (with
grss_feeds_publisher_hub_switch()
) this function exposes the given channel
as an Atom formatted file avalable to http://[LOCAL_IP:DEFINED_PORT]/id
.
|
a GrssFeedsPublisher. |
|
the GrssFeedChannel to dump in the file. |
|
list of GrssFeedItems to be added in the feed. |
|
name used in the external URL of the feed. |
|
if an error occourred, FALSE is returned and this is filled with the
message. |
Returns : |
TRUE if the file is successfully written, FALSE otherwise. |
gboolean grss_feeds_publisher_publish_file (GrssFeedsPublisher *pub
,GrssFeedChannel *channel
,GList *items
,const gchar *uri
,GError **error
);
Dump the given channel
in an Atom formatted file in path
. If the local
PubSubHubbub hub has been activated (with grss_feeds_publisher_hub_switch()
)
notifies remote subscribers about the new items which has been added since
previous invocation of this function for the same GrssFeedChannel.
|
a GrssFeedsPublisher. |
|
the GrssFeedChannel to dump in the file. |
|
list of GrssFeedItems to be added in the feed. |
|
URI of the file to write. The full path must exists. |
|
if an error occourred, FALSE is returned and this is filled with the
message. |
Returns : |
TRUE if the file is successfully written, FALSE otherwise. |
void grss_feeds_publisher_hub_set_port (GrssFeedsPublisher *pub
,int port
);
To customize the port opened by the local server to deliver feeds and catch incoming subscriptions. By default this is 80. Changing the port while the hub is running imply restart the local server.
|
a GrssFeedsPublisher. |
|
new listening port for the server. |
void grss_feeds_publisher_hub_set_topics (GrssFeedsPublisher *pub
,GList *topics
);
To define a list of valid "topics" for which the GrssFeedsPublisher will
deliver contents. Sources of those channels, as retrieved by
grss_feed_channel_get_source()
, are accepted as "hub.topic" parameter in
PubSubHubbub registration requests from remote subscribers.
Pay attention to the fact subscriptions requests for different topic are
now rejected.
|
a GrssFeedsPublisher. |
|
a list of GrssFeedChannels. |
void grss_feeds_publisher_hub_switch (GrssFeedsPublisher *pub
,gboolean run
);
Permits to start and stop the webserver implemented by this object.
|
a GrssFeedsPublisher. |
|
TRUE to run the local server, FALSE to stop it. |
"delete-subscription"
signalvoid user_function (GrssFeedsPublisher *grssfeedspublisher,
GrssFeedChannel *arg1,
gchar *arg2,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"new-subscription"
signalvoid user_function (GrssFeedsPublisher *grssfeedspublisher,
GrssFeedChannel *arg1,
gchar *arg2,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |