Created
February 19, 2016 08:51
-
-
Save xjackk/f6e074244ddd25738498 to your computer and use it in GitHub Desktop.
Random Cat Picture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getCats = -> | |
$.get 'http://thecatapi.com/api/images/get?format=xml&size=med&results_per_page=20', (data) -> | |
xmlimages = $(data).find 'image' | |
randomimage = xmlimages[Math.floor(Math.random() * xmlimages.length)] | |
imageurl = $(randomimage).find("url").text() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cats everywhere ~