Skip to content

Instantly share code, notes, and snippets.

@crazy4groovy
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crazy4groovy/4d1f90dc435b4a18f80c to your computer and use it in GitHub Desktop.
Save crazy4groovy/4d1f90dc435b4a18f80c to your computer and use it in GitHub Desktop.
List top Flickr "Explore" images for the day
import groovy.json.*
String r = new URL("https://www.flickr.com/explore?data=1&day=${Calendar.instance.previous().format('YYYY-MM-dd')}&view=ju&start=1&count=500&append=0").text
int line = 0
String data
r.eachLine {
line++
if (it.contains('modelExport:')) {
data = it[15..-2]
println "******************* $line + ${data[0..200]}..."
}
}
def resp = new JsonSlurper().parseText(data)['explore-models'].photos._data
resp.each { println (it.sizes.k?.url ?: it.sizes.h?.url ?: it.sizes.l?.url) }
println resp.size()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment