This page covers additional extensions for XMPP-FTW.
These extensions are loaded into the XMPP-FTW demo client. This document follows the conventions of the main manual page.
For more information about the Superfeedr XMPP API please see: .
Whilst superfeedr allows users to subscribe to multiple feeds in one request for simplicity this is restricted to a single subscription per request.
socket.send(
'xmpp.superfeedr.subscribe',
{
"feed": "http://www.evilprofessor.co.uk/feed",
/* "jid": "[email protected]" */
},
function(error, data) { console.log(error, data) }
)
If no JID is provided this defaults to the jid used to log in to the server with.
If a subscription is successful then the response will look like the following:
{
"feed": "http://www.evilprofessor.co.uk/feed",
"jid": "[email protected]/sky",
"title": "Building a time machine from a Delorean",
"status": {
"response": 200,
"fetch": {
"last": "1955-11-05T06:30:11-08:00",
"next": "1985-10-27T01:22:38-08:00",
"period": "3600"
},
"parsed": "1985-10-27T10:30:00-08:00",
"maintenance": "1985-10-27T09:59:00-08:00",
"message": "9718 bytes fetched in 1.462708s : 2 new entries."
}
}
socket.send(
'xmpp.superfeedr.unsubscribe',
{
"feed": "https://github.com/xmpp-ftw.atom",
/* "jid": "[email protected]" */
},
function(error, data) { console.log(error, data) }
)
If there is no error `data` will simply be true.
socket.send(
'xmpp.superfeedr.subscriptions',
{
/* "page": 1 */
},
function(error, data) { console.log(error, data) }
Response will then appear as follows:
[
{
"feed": "http://www.evilprofessor.co.uk/feed",
"jid": "[email protected]/sky",
"title": "Building a time machine from a Delorean",
"status": {
"response": 200,
"fetch": {
"last": "1955-11-05T06:30:11-08:00",
"next": "1985-10-27T01:22:38-08:00",
"period": "3600"
},
"parsed": "1985-10-27T10:30:00-08:00",
"maintenance": "1985-10-27T09:59:00-08:00",
"message": "9718 bytes fetched in 1.462708s : 2 new entries."
}
}
]
An example of an item is as follows:
{
"title": "Hello world",
"id": "http://push-pub.appspot.com/feed/793002",
"updated": "2013-05-12T15:34:15Z",
"published": "2013-05-12T15:34:15Z",
"content": {
"type": "text",
"content": "Get a notification"
},
"links": [
{
"title": "Hello world",
"rel": "alternate",
"href": "http://push-pub.appspot.com/entry/793002",
"type": "text/html"
}
]
}
{
meta: {
"response": 200,
"fetch": {
"last": "1955-11-05T06:30:11-08:00",
"next": "1985-10-27T01:22:38-08:00",
"period": "3600"
},
"parsed": "1985-10-27T10:30:00-08:00",
"maintenance": "1985-10-27T09:59:00-08:00",
"message": "9718 bytes fetched in 1.462708s : 2 new entries."
},
items: "items": [
{ ... }
]
}
socket.send(
'xmpp.superfeedr.retrieve',
{
"feed": "http://www.evilprofessor.co.uk/feed"
},
function(error, data) { console.log(error, data) }
)
Example response:
{
meta: {
"response": 200,
"fetch": {
"last": "1955-11-05T06:30:11-08:00",
"next": "1985-10-27T01:22:38-08:00",
"period": "3600"
},
"parsed": "1985-10-27T10:30:00-08:00",
"maintenance": "1985-10-27T09:59:00-08:00",
"message": "9718 bytes fetched in 1.462708s : 2 new entries."
},
items: [
{ ... }
]
}
The buddycloud extension details can no tbe found on their own page: Buddycloud extension for XMPP-FTW.
If not using the fanout gateway, then anonymous login is performed as follows:
socket.send(
'xmpp.login.anonymous',
{ jid: 'anon.fanout.io' }
)
If using the fanout gateway then the payload can simply be any empty object.
Subscribe to fanout events as follows:
socket.send(
'fanout.fpp.subscribe',
{
"channel": "your-channel",
"realm": "your-realm",
/* "to": "pubsub.fanout.io" */
},
function(error, data) { console.log(error, data) }
)
On successful subscription `data` wil simply be true.
Not providing to key will default it to the value in the example payload.
socket.send(
'fanout.fpp.unsubscribe',
{
"channel": "your-channel",
"realm": "your-realm",
/* "to": "pubsub.fanout.io" */
},
function(error, data) { console.log(error, data) }
)
On successful unsubscribe `data` wil simply be true.
Not providing to key will default it to the value in the example payload.
{
"from": "pubsub.fanout.io",
"channel": "your-channel",
"realm": "your-realm",
"content": {
"json": { ... the JSON content ... }
}
}