Created
June 18, 2020 19:05
-
-
Save xbony2/7dc5305a2e57d8d2f2a99bf09448cc16 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 "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