Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Random Cat Picture
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()
Owner

xjackk commented Feb 19, 2016

cats everywhere ~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment