Croudia client API for node.js
node-croudia aims to provide a complete, asynchronous client library for the Croudia API, including the REST and search endpoints. It was inspired by, and uses some code from, @AvianFlu's ntwitter.
Installation
You can install node-croudia and its dependencies with npm: npm install croudia
.
Getting started
The most significant API change involves error handling in callbacks. Callbacks now receive the error as a separate parameter, rather than as part of the data. This is consistent with node's standard library. Callbacks should now look something like this:
{if err return ;// Do something with 'result' here}
Where callback
is the parent function's callback. (Or any other function you want to call on error.)
Setup API
The keys listed below can be obtained from https://developer.croudia.com after setting up a new App.
var Croudia = ;var crou =consumer_key: 'consumer key here'consumer_secret: 'consumer secret here';
Authentication API
var authorizeUrl = crou;console;// open browser and input authorizeUrlvar responsedUrl = 'responsed url here';crou;
REST API
Interaction with other parts of Croudia is accomplished through their RESTful API. The best documentation for this exists at developer.croudia.com. Convenience methods exist for many of the available methods, but some may be more up-to-date than others. If your Croudia interaction is very important, double-check the parameters in the code with Croudia's current documentation.
crou;
Method list
Please refer to the doc directory for more information on each method.
/** Basic api access */Croudia#;Croudia#;/** Authentication resources */Croudia#;Croudia#;Croudia#;Croudia#;/** Timeline resources */Croudia#;Croudia#;Croudia#;Croudia#;/** Voice resources */Croudia#;Croudia#;Croudia#;Croudia#deleteStatus = CroudiaprototypedestroyStatus;Croudia#;Croudia#getStatus = CroudiaprototypeshowStatus;/** Secret mail resources */Croudia#;Croudia#;Croudia#getSentSecretMails = CroudiaprototypegetSecretMailsSent;Croudia#;Croudia#updateSecretMail = CroudiaprototypesendSecretMail = CroudiaprototypenewSecretMail;Croudia#;Croudia#deleteSecretMail = CroudiaprototypedestroySecretMail;Croudia#;Croudia#getSecretMail = CroudiaprototypeshowSecretMail;/** User resources */Croudia#;Croudia#;Croudia#showUsers = CroudiaprototypelookupUsers;/** Various setting resources */Croudia#;Croudia#;Croudia#;/** Friendship resources */Croudia#;Croudia#;Croudia#deleteFriendship = CroudiaprototypedestroyFriendship;Croudia#;Croudia#;Croudia#;Croudia#;Croudia#;Croudia#;/** Favorites resources */Croudia#;Croudia#;Croudia#favoriteStatus = CroudiaprototypecreateFavorite;Croudia#;Croudia#deleteFavorite = CroudiaprototypedestroyFavorite;/** Spread resources */Croudia#;/** Search resources */Croudia#;Croudia#;
TODO
- Unit test
- Fix all the things! on the GitHub issues list