To use sockethub from within the browser, you'll be establishing a websocket client and sending and receiving simple JSON objects to the client.
First, include the
sockethub-client.js
script, and then the following sequence connects to Sockethub, sets your Twitter credentials, and fetches your tweets:
This example assumes you're running Sockethub on
localhost:10550
The 4 values you have to put in for the Twitter credentials can be obtained by registering a Twitter app and then also generating an access token.
Now watch the console. You should see a series of "messages" events after a few "completed" events, logged to the console.
For more examples, you can browse to
http://localhost:10550/examples
and for more documentation see the Sockethub Wiki.