Scrap and serve VDM from http://viedemerde
git clone https://github.com/FXHibon/vdm-tool
cd vdm-tool
npm install
In order to log on standard output, set an en variable like this:
export DEBUG=vdm:*
Before starting vdm-tools, ensure you have a MongoDb instance running. DB connection url can be modified in config file
Fetch VDM from viedemerde, limited by the config (200 by default). Items are stored in local mongodb
./index.js --fetch
Serve all fetched VDM through REST API. See end-points description below
./index.js --serve
- /api/posts: list all VDM
- /api/posts?author=x: list all VDM from given author
- /api/posts?from=x: list all VDM after x
- /api/posts?to=x: list all VDM before x
- /api/posts?from=x&to=y: list all VDM between x and y
- /api/posts/:id: get one VDM
./index --help
npm test
Tested on linux.
You can customize some parameters through config file. Available parameters are:
- maxItems: how many items will be retrieved
- remoteUrl: viedemerde url, should not be changed
- mongoUrl: Mongo instance url
- dbName: DB name where the items will be stored
- port: Determine wich port will be used by the REST API