Skip to content

Instantly share code, notes, and snippets.

@xbony2
Created November 10, 2015 22:51
Show Gist options
  • Save xbony2/53131a8bad9179c619c4 to your computer and use it in GitHub Desktop.
Save xbony2/53131a8bad9179c619c4 to your computer and use it in GitHub Desktop.
require_relative 'lib/mediawiki-butt'
require 'open-uri'
butt = MediaWiki::Butt.new("http://habbo.gamepedia.com")
butt.login("ESAEBSAD", "-REDACTED-")
butt.get_category_members("Category:Missing badge image").each do |page|
text = butt.get_text(page)
id = text.match(/id=(.+)\}\}/)[0].delete("id=").delete("}}")
begin
read_file = open("http://habboo-a.akamaihd.net/c_images/album1584/#{id}.gif")
rescue OpenURI::HTTPError
puts "File not found."
else
puts "File found."
write_file = File.new("Downloads/#{id}.gif", "wb")
write_file.write(read_file.read)
write_file.close
end
end
Copy link

ghost commented May 30, 2016

Is this needed any more as it's ran by a maintenance script now.

@xbony2
Copy link
Author

xbony2 commented May 31, 2016

@cblair91 I've only used this once, but I like to keep code on me in case I need it for reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment