Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/ralyodio/getrandomdate
- Owner: ralyodio
- Created: 2015-01-03T10:40:19.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-08-14T17:26:09.000Z (over 6 years ago)
- Last Synced: 2024-10-06T10:42:17.589Z (about 1 month ago)
- Language: JavaScript
- Homepage: http://getrandomdate.com
- Size: 18.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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")