appdotcouchdeprecated

Export global app.net stream to CouchDB

Usage no npm install needed!

<script type="module">
  import appdotcouch from 'https://cdn.skypack.dev/appdotcouch';
</script>

README

appdotcouch

Export global app.net stream to CouchDB.

Requirements

You need a valid access token from app.net. See here how to gain one https://github.com/appdotnet/api-spec/blob/master/auth.md#server-side-flow-ruby-python-php-java-etc.

Then run npm install -g appdotcouch to install this script.

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
--minid [value]               api parameter min_id
--maxid [value]               api parameter max_id
--count [value]               api parameter count
--includeuser [value]         api parameter include_user
--includeannotations [value]  api parameter include_annotations
--includereplies [value]      api parameter include_replies

Code

You can also use this module in your own code directly – just require('appdotcouch').

var AppDotCouch = require('appdotcouch'),
    config = require('config.json'),
    obj = AppDotCouch.create(config);

obj.dump();

All options in config should exectly be named like they are in the CLI.

API

AppDotCouch()

Create a new AppDotCouch object with cfg.

Params:

  • Object cfg configuration

Return:

  • Object new AppDotCouch object

AppDotCouch.create(cfg)

Convenience constructor for AppDotCouch.

Params:

  • Object cfg configuration

Return:

  • Object new AppDotCouch object

obj.dump(cb)

Dump the latest posts from app.net to couch db and callback cb(err).

Params:

  • Function cb

Developers

Feel free to contribute to this project. There are some unit tests included in this project, type npm test and be sure to have a local couch db without username and password and an empty database called appdotcouch. Just be sure to set an access token in `test/appdotcouch.js.