Created
November 10, 2015 22:51
-
-
Save xbony2/53131a8bad9179c619c4 to your computer and use it in GitHub Desktop.
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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@cblair91 I've only used this once, but I like to keep code on me in case I need it for reference.