Created
December 29, 2011 08:36
-
-
Save gnurag/1532969 to your computer and use it in GitHub Desktop.
Sorts and prints highest votes pics.
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
# Paste all the urls (newline separated) into a file named "urls" in the following format. | |
# [http://www.flickr.com/photos/example/123456789] | |
u = File.open('urls').readlines | |
h = {} | |
u.each{|url| url.strip!; h[url].nil? ? h[url]=1 : h[url]+=1 } | |
h.sort{|a,b| a[1] <=> b[1]}.reverse.each{|x| puts "#{x[0].chomp} => #{x[1]}"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment