Skip to content

Instantly share code, notes, and snippets.

@tommorris
Created August 30, 2008 19:57
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 tommorris/8138 to your computer and use it in GitHub Desktop.
Save tommorris/8138 to your computer and use it in GitHub Desktop.
A script to check for spam on Gist
require 'open-uri'
require 'hpricot'
def isAnonymousGist(url)
(Hpricot(open(url))/"div[@class = 'file']").each { |i|
if (i/"span[@class = 'date']/a[@href]").size == 0
url = "http://gist.github.com" + (i/"div[@class = 'info']/span/a")[0]['href']
system "open \"" + url + "\""
puts url
end
}
end
(144..554).each do |i|
url = "http://gist.github.com/gists?page=" + i.to_s
isAnonymousGist (url)
sleep 5
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment