Skip to content

Instantly share code, notes, and snippets.

@chintanparikh
Created December 9, 2013 02:31
Show Gist options
  • Save chintanparikh/7866602 to your computer and use it in GitHub Desktop.
Save chintanparikh/7866602 to your computer and use it in GitHub Desktop.
require 'nokogiri'
require 'open-uri'
for i in 1..1000
doc = Nokogiri::HTML(open("http://www.saavn.com/u/pratyushraman#{i}"));
valid_pratyush = []
doc.xpath('//*[@id="main"]/div/div[2]/ul/li[1]/a/em').each do |a|
valid_pratyush << a.content + " - pratyushraman#{i}" if a.content.to_i > 0
puts i
end
valid_pratyush.each do |user|
puts user
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment