Hi everyone!
I don’t make a habit of announcing every Sockethub release here, but the latest one (v0.0.11) is looking very good, quite stable, robust and with better documentation. (Changelog) [1]
See the README [2] or doc/install.md [3] for simple instructions on getting sockethub running on your system.
Implementing Sockethub in your web application is very simple. You can include the sockethub-client [4] library, and create a connection object:
var sc = SockethubClient.connect('localhost', {
register: {
secret: '1234567890'
}
});
sc.on('registered', function () {
console.log('connected and registered with sockethub!');
});
sc.on('failure', function (e) {
console.log('failed connecting to sockethub ', e);
});
Once you’re connected and registered you can freely send and receive messages from the server.
sc.on('message', function (o) {
console.log('received article from ' + o.actor.address);
});
sc.sendObject({
'platform': 'rss',
'verb': 'fetch',
'target': [{'address':'http://example.com/rss'}],
}).then(function () {
console.log('fetch processed sucessfully');
}, function (e) {
console.log('error with fetch: ', e);
});
That’s it! Assuming you’ve entered a correct RSS/Atom feed URL, you should get a success result from sendObject, and then start getting a ‘message’ event for each article fetched.
For more docs on using sockethub, see the sockethub-client repo [4] and the sockethub comprehensive platform overview doc [5].
The above RSS example is similar to what’s being implemented in Dogfeed (unhosted feed reader) [6] however it’s currently not working, waiting on a few remoteStorage bugs to be resolved. Should be soon though!
Please let me know if you have any questions, suggestions or issues with sockethub or sockethub-client.
Cheers
Nick
[1] https://github.com/sockethub/sockethub/blob/master/CHANGELOG.md
[2] https://github.com/sockethub/sockethub/blob/master/README.md
[3] https://github.com/sockethub/sockethub/blob/master/doc/install.md
[4] https://github.com/sockethub/sockethub-client
[5] https://github.com/sockethub/sockethub/blob/master/doc/platform_overview.md