appdotcouch
Export global app.net stream to CouchDB.
This is is a CLI, but you can also use it in your own node procjects. Be sure to checkout the api description at the bottom.
Important You need a valid access token from app.net to use this tool.
How to get an access token
- https://npmjs.org/package/appdotauth
- https://github.com/appdotnet/api-spec/blob/master/auth.md#how-do-i-get-an-access-token
CLI
Usage: appdotcouch [options]
Options:
-h, --help output usage information
-V, --version output the version number
--token [value] app.net auth token
--db [value] uri to couch db
--uri [value] app.net api uri for global stream
--sinceid [value] api parameter since_id
--beforeid [value] api parameter before_id
--count [value] api parameter count
--includeuser [value] api parameter include_user
--includeannotations [value] api parameter include_annotations
--includereplies [value] api parameter include_replies
Developers
Please make sure to include unit tests, if you want to contribute to this project.
To run the unit tests, there are several steps to do:
- install this package with
npm install -g appdotcouch
- start your CouchDB and create a database
- register an application at https://alpha.app.net/developer/app/create/ (dev accounts only)
cp config.example.json config.json
- insert your application details at
config.json
- run tests with
npm test
Examples
AppDotCouch
object.dump()
returns no error.
client.dump(function (err) {
should.not.exist(err);
done();
});
API
AppDotCouch()
Create a new AppDotCouch object with token
and filters
.
Params:
-
String db CouchDB uri
-
String token app.net auth token
-
Object filters for the request
Return:
- Object new AppDotCouch object
AppDotCouch.create(db, token, filters)
Convenience constructor for AppDotCouch
.
Params:
-
String db CouchDB uri
-
String token app.net auth token
-
Object filters for the request
Return:
- Object new AppDotCouch object
object.dump(cb)
Dump the latest posts from app.net to CouchDB and callback cb(err)
.
Params:
- Function cb