Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ralyodio/getrandomdate

Get a random date for a given time-frame in JSON, XML, or CSV format.
https://github.com/ralyodio/getrandomdate

Last synced: 19 days ago
JSON representation

Get a random date for a given time-frame in JSON, XML, or CSV format.

Awesome Lists containing this project

README

        

# getRandomDate

Get a random date for a given time-frame in JSON, XML, or CSV format.

-

## install

If you want to run the app locally on your own server, you can install it:

git clone [email protected]:chovy/getrandomdate.git
cd getrandomdate
npm install
node ./server/index.js

Github repo:

## endpoints

### /days-ago/:days

Change format by adding extension `.json`, `.xml`, or `.csv`

Generate a random date from the last 7 days:

GET /days-ago/7.json
GET /days-ago/7.xml
GET /days-ago/7.csv

Generate 10 random dates:

GET /days-ago/7.json?count=10

- [/days-ago/7.json](/days-ago/7.json)
- [/days-ago/7.json?count=10](/days-ago/7.json?count=10)

## example usage:

var request = require('request');
var url = 'http://getrandomdate.com/days-ago/7.json';

request(url, {json: true}, function(err, res, body){
console.log(body);
});

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/chovy/getrandomdate/trend.png)](https://bitdeli.com/free "Bitdeli Badge")