HelloJS Modules

HelloJS is extensible, i.e. you can add new services to it as long as you can get your head around the important parts.

Modules are just small javascript scripts that define the URL's for things like the login page and the REST'ful webserver. They're also a place which standardise a naming convention e.g. path locations, scopes, data response and delivery mechanisms.

HelloJS already has you connected

The table shows the services which are already documented on HelloJS. Simply include these scripts in your page after your HelloJS script tag

extension demo credits
dropbox.js dropbox demo
facebook.js
foursquare.js foursquare demo
github.js github demo
google.js
linkedin.js linkedin demo
soundcloud.js soundcloud demo
twitter.js twitter demo
windows.js
yahoo.js yahoo demo

Writing your own module

Modules are loaded into helloJS using the hello.init() method, with a JSON object that has the name of the service as the only key and then whose value consists of an object with the following parameters.

name type example description argument default
url Object An array=>key map of the paths to translate. The keys "auth" and "base" are required required
oauth Object
nametypedescription
version string Version of OAuth, "1.0", "1.0a", "2"
request url Path of the first leg of OAuth 1
auth url Path of the authorization URL, second leg of OAuth 1
token url Path to get the Access token, the third leg of OAuth 1
optional*
scope Object An array=>key map of the scopes to translate optional
scope_delim string ,, Overrides the default delmiter between multiple scopes optional ,
wrap Object An array=>key map of pathnames, used to pre-process the response objects returned optional
querystring function A function to preprocess the querystring optional true
xhr function A function which if the browser supports XHR2 can be used to augment the request further, the function can return a boolean false to cancel this delivery mechanism and fallback to another optional true
jsonp function A function which if the data lends itself to transport over JSONP can be used to augment the request further, the function can return a boolean false to cancel this delivery mechanism and fallback to another optional
post function A function which if the browser supports the Form+Iframe+Hash hack, can be used to augment the request further, the function can return a boolean false to cancel this delivery mechanism and fallback to another optional

*optional: If the service is an OAuth 1.0/1.0a version then 'oauth' object is required.

Contributing modules

That would be fantastic if you could. Please make the following updates so its easiy for people to discover and test.