A simple BSD Fortune API.
See the original one built using Ruby and Sinatra at http://github.com/guivinicius/fortune-api
With NPM it's pretty simple.
cd ~/YOUR_PATH/fortune-api-nodejs/
npm start
Then go to http://localhost:3000/
The app is based on the Fortune program, so you will need it.
brew update
brew install fortune
sudo apt-get update
sudo apt-get install fortune
/fortune.json
/fortune
- long
- 0 = only short fortunes (<= 160)
- 1 = only longer fortunes (> 160)
- nil = random
- dirty
- 0 or nil = only non offensive fortunes
- 1 = only offensive fortunes
/fortunes?long=1
/fortunes?dirty=1
/fortunes?dirty=1&long=1
The difference between a career and a job is about 20 hours a week.
/fortunes.json?long=1
/fortunes.json?dirty=1
/fortunes.json?dirty=1&long=1
{
"text": "The difference between a career and a job is about 20 hours a week."
}