Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fernferret/fortune
Very cheap fortune cookie app to demonstrate JSON and Android
https://github.com/fernferret/fortune
Last synced: about 2 months ago
JSON representation
Very cheap fortune cookie app to demonstrate JSON and Android
- Host: GitHub
- URL: https://github.com/fernferret/fortune
- Owner: fernferret
- Created: 2011-05-04T05:39:34.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-05-04T18:40:51.000Z (over 13 years ago)
- Last Synced: 2024-10-11T03:22:02.925Z (3 months ago)
- Language: Ruby
- Homepage:
- Size: 97.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#Intro to Android Development - CSSE 490#
##Rose-Hulman Institute of Technology##
##Dr. Fisher##The following is the JSON API reference for myfortune.heroku.com
# Getting fortunes by posting data #
##Getting a specific fortune##
###URL: myfortune.heroku.com/fortune/###
The JSON object should be posted in 'data' as follows:data =>
{
"id": "1"
}and will return a JSON object that looks like this:
__Success__
{
"result": "success",
"fortune": "A neat fortune."
}__Failure__
{
"result": "fail"
}##Getting a __random__ fortune##
###URL: myfortune.heroku.com/fortune/###
The JSON object should be posted in 'data' as follows:data =>
{
"random": "true"
}and will return a JSON object that looks like this:
__Success__
{
"result": "success",
"fortune": "A neat random fortune."
}__Failure__
{
"result": "fail"
}
# Getting fortunes by URL ###Getting the number of fortunes in the system##
###URL: myfortune.heroku.com/fortunes/###
Will return a JSON object that looks like this:__Success__
{
"result": "success",
"count": 30
}__Failure__
{
"result": "fail"
}##Getting a specific fortune##
###URL: myfortune.heroku.com/fortune/:id/###
Where :id is the integer id of the fortune you want
Will return a JSON object that looks like this:__Success__
{
"result": "success",
"fortune": "A neat fortune."
}__Failure__
{
"result": "fail"
}##Getting a __random__ fortune##
###URL: myfortune.heroku.com/fortune/random/###
Will return a JSON object that looks like this:__Success__
{
"result": "success",
"fortune": "A neat random fortune."
}__Failure__
{
"result": "fail"
}