Skip to content

Instantly share code, notes, and snippets.

@xbony2
Created June 18, 2020 19:05
Show Gist options
  • Save xbony2/7dc5305a2e57d8d2f2a99bf09448cc16 to your computer and use it in GitHub Desktop.
Save xbony2/7dc5305a2e57d8d2f2a99bf09448cc16 to your computer and use it in GitHub Desktop.
require "mediawiki-butt"
butt = MediaWiki::Butt.new("https://ftb.gamepedia.com/api.php", assertion: :bot)
puts "Enter your password"
STDOUT.flush
butt.login("ESAEBSAD@ESAEBSAD-bot", gets.chomp)
butt.get_category_members("Tilesheets", "file").each do |tilesheet|
match = /(File:Tilesheet [A-Z\d-]+ \d\d)\.png/.match(tilesheet)
next if match.nil?
new_loc = "#{match[1]} 0.png"
puts "#{tilesheet} -> #{new_loc}"
butt.move(tilesheet, new_loc) # Note here a redirect will be automatically created.
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment