Some code for card APIs

This is post is for the 8 teams of CMPT 225 students working on a Phylogame app.  Note that there is apparently a small error in this script (we’ll get Enej to take a look when he gets back from vacation).
Cheers
Dave
**************************************************************************************
*  API DOCS v0.5
**************************************************************************************
URL API Parameters:
api – can eather be json or xml default is json, has to be present
num – returns the number of cards maximum is 200 default is 20
page – page number to get to the page = 2 for second page
callback – only applicable to json will call the callback function with the json data passed into it.
if you don’t have a callback parameter specified phylomon_cards will be returned with with the data inside it.
diy – set this parameter to get back the diy cards instead
URL that will work.
Urls you can visit.
homepage:
cards:
diy-cards:
single card url:
Example urls:
http://phylogame.org/?api=json&num=200&page=2 // – gets 200 cards on the second page as a json_object
same example HTML
<script>
function get_cards(data) {
alert(‘The first card is ‘+data[0].name );
console.log( data[0] );
}
</script>
<script src=”http://phylogame.org/?api=json&callback=get_cards”></script>
<!– <script src=”http://phylogame.org/2013/04/evening-grosbeak/?api=1&callback=get_cards”></script> –>
*/

Happy Arbor Day! Here are some Phylo tree cards!

From Wikipedia:

“Arbor Day (from the Latin arbor, meaning tree) is a holiday in which individuals and groups are encouraged to plant and care for trees. It originated in Nebraska City, Nebraska, United States by J. Sterling Morton. The first Arbor Day was held on April 10, 1872 and an estimated one million trees were planted that day. Many countries now observe a similar holiday. Though usually observed in the spring, the date varies, depending on climate and suitable planting season.”

Download the cards here. Download card back here.