Last active
August 29, 2015 14:15
-
-
Save crazy4groovy/4d1f90dc435b4a18f80c to your computer and use it in GitHub Desktop.
List top Flickr "Explore" images for the day
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
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