Skip to content

FXHibon/vdm-tool

Repository files navigation

vdm-tool

Scrap and serve VDM from http://viedemerde

Installation

git clone https://github.com/FXHibon/vdm-tool
cd vdm-tool
npm install

Usage

Log

In order to log on standard output, set an en variable like this:

export DEBUG=vdm:*

DB

Before starting vdm-tools, ensure you have a MongoDb instance running. DB connection url can be modified in config file

Scrap

Fetch VDM from viedemerde, limited by the config (200 by default). Items are stored in local mongodb

./index.js --fetch

Serve

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

Display help

./index --help

Tests

npm test

Tested on linux.

Configuration

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published