move old and add new examples
This commit is contained in:
parent
9a688fc5c6
commit
384bc445c2
4 changed files with 52 additions and 0 deletions
16
examples/fix-links
Executable file
16
examples/fix-links
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env ruby
|
||||
require '../mediawikibot'
|
||||
|
||||
if ARGV.size() != 2
|
||||
$stderr.print($0 + " <wiki-user> <wiki-password>\n")
|
||||
exit(1)
|
||||
end
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
b = MediaWikiBot::WikiBot.new("http://entropia.de/wiki/")
|
||||
b.login(ARGV[0], ARGV[1])
|
||||
|
||||
old = b.get_raw("RoboRally")
|
||||
new = old.gsub(/\[#reg ([^|]*?)\]/i, '[[#Gesperrte Register|\1]]')
|
||||
b.edit("RoboRally", new, "Kaputte interne Links repariert")
|
Reference in a new issue