![]() |
![]() |
![]() |
libgrss Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
FeedsSubscriber; FeedsSubscriber* feeds_subscriber_new (); gboolean feeds_subscriber_listen (FeedsSubscriber *sub
,GList *feeds
); GList* feeds_subscriber_get_listened (FeedsSubscriber *sub
); void feeds_subscriber_set_port (FeedsSubscriber *sub
,int port
); void feeds_subscriber_set_hub (FeedsSubscriber *sub
,gchar *hub
); void feeds_subscriber_switch (FeedsSubscriber *sub
,gboolean run
);
FeedsSubscriber is an alternative for FeedsPool, able to receive
real-time notifications by feeds managed by a PubSubHub hub.
When the subscriber is executed (with feeds_subscriber_switch()
) it opens
a server on a local port (configurable with feeds_subscriber_set_port()
),
engage a subscription for each FeedChannel passed with
feeds_subscriber_listen()
, and waits for direct notifications by the
remote hub.
For more information look at http://code.google.com/p/pubsubhubbub/
FeedsSubscriber* feeds_subscriber_new ();
Allocates a new FeedsSubscriber
Returns : |
a new FeedsSubscriber |
gboolean feeds_subscriber_listen (FeedsSubscriber *sub
,GList *feeds
);
To set the list of feeds to be managed by sub
. The previous list, if any,
is invalidated. After invokation to the function, feeds_subscriber_switch()
must be call to run the subscription.
The list in feeds
can be freed after calling this; linked FeedChannel
are g_object_ref'd here
|
a FeedsSubscriber |
|
a list of FeedChannel |
Returns : |
TRUE if all FeedChannels involved in feeds are valid
(feed_channel_get_pubsubhub() returns TRUE ), FALSE otherwise
|
GList* feeds_subscriber_get_listened (FeedsSubscriber *sub
);
Returns the list of feeds currently managed by sub
|
a FeedsSubscriber |
Returns : |
a list of FeedChannel, to be freed with g_list_free() when
no longer in use. Do not modify elements found in this list
|
void feeds_subscriber_set_port (FeedsSubscriber *sub
,int port
);
To customize the port opened by the local server to catch incoming publishers' events. By default this is 8444. Changing the port while the subscriber is running imply restart the local server. Pay attention to the fact many publishers' implementations accept only certain ports
|
a FeedsSubscriber |
|
new listening port for the server |
void feeds_subscriber_set_hub (FeedsSubscriber *sub
,gchar *hub
);
To customize the default hub to which send subscriptions. If this value is set, hubs from specific feeds are ignored
|
a FeedsSubscriber |
|
URL of the custom hub |
void feeds_subscriber_switch (FeedsSubscriber *sub
,gboolean run
);
Permits to pause or resume sub
listening for events
|
a FeedsSubscriber |
|
TRUE to run the subscriber, FALSE to pause it |
"notification-received"
signalvoid user_function (FeedsSubscriber *pool, GObject *feed, GObject *item, gpointer user_data) : Run Last
Emitted when a notification has been received and parsed. The
item
is unref'd at the end of signal
|
the FeedsSubscriber emitting the signal |
|
the FeedChannel which has been updated |
|
the FeedItem received |
|
user data set when the signal handler was connected. |