Warning
The project is dead and some links have been removed from this post. (2015-12-02T00:25:07Z)
ItchApe is a simple solution which enables you showing off your apes current itch to the world. You scratch your ape and its itch can be read.
Contents
1 Features
- An itch can be described in up to 140 characters. (Its not a bird, its an ape!) Every character will be shown literally, no HTML will take effective.
2 Notes
- An itch can be kept up to an hour, but there is no guarantee since itches are stored in memory cache.
- All itches will not be stored in database. Once they are gone from memory cache, they are gone.
3 Get started
3.1 Adopt an Ape
You need to adopt an ape first, you will get a Secret Key and Ape ID after you submit your Secret Phrase. Make sure you write down these three information.
3.2 Install the code
Once you have your Ape ID, you can install the following HTML code,
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script src="http://lilbtn.appspot.com/itchape/itchape.js"></script> <script>get_itch('<YOUR_APE_ID>', 'itchdiv')</script> <div>My ItchApe: <span id="itchdiv"></span></div>
The itch will be shown in itchdiv. It may read like:
My ItchApe: This is my itch (3 minutes ago)
3.3 Scratch your ape
You can scratch your ape, enter the description of the itch and the phrase, key, and ID.
3.4 Scripts
There are two basic Bash scripts for scratching and getting itch, you can download them on Google Code.
4 Developers Information
4.1 Rendered code
The rendered HTML code by /itchape/itchape.js looks like
<span class="itch">The description of itch.</span> <span class="itch_timesince">(3 mintues ago)</span>
4.2 /itchape/getitch.json API
If you want to write your own script, here is how you get the itch. Send a GET request to http://lilbtn.appspot.com/itchape/getitch.json?ape_id=<APE_ID>, the return data is a JSON or JSONP if you also give callback in query string,
{ "ape_says": "...", "itch": "...", "scratched_at": 123456789.123 }
- ape_says is actually the error message, it may have the values listed in ape_says section below.
- itch is the description of the itch.
- scratched_at is time of the ape gets scratched, the seconds after Unix epoch, its a float number.
4.3 /itchape/scratch API
If you request using GET method, then it will be a normal page. If you request using POST method, its the API for scratching.
You need to supply secret_phrase, secret_key, ape_id, and itch. If its a successful call, then the data will be sent back as if you make a getitch.json call; if not, then you will get this json {"ape_says":"I'm not your ape"}.
You can also supply callback for JSONP.
4.4 ape_says (error message)
- "Yeah, I was itching for that!": An itch description is retrieved successfully.
- "Not itching, yet!": There is no data in memory cache for that Ape ID.
- "I'm not your ape!": The phrase, key, and ID do not match, there you cant scratch this ape.
- "Oooh... that feels good!": Scratch is successful and wonderful.
You have to parse these message, there is no error codes or simple true/false to know if its successful or not. Ape doesnt know about whats an API, they say what they want.
5 Support
If you have anything want to report or to request, please submit an issue to issue tracker.
0 comments:
Post a Comment