You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
|
|
|
|
#!/usr/bin/env ruby
|
|
|
|
|
require '../mediawikibot'
|
|
|
|
|
|
|
|
|
|
if ARGV.size() != 2
|
|
|
|
|
$stderr.print($0 + " <wiki-user> <wiki-password>\n")
|
|
|
|
|
exit(1)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
# Rock!
|
|
|
|
|
|
|
|
|
|
b = MediaWikiBot::WikiBot.new("http://entropia.de/wiki/")
|
|
|
|
|
b.login(ARGV[0], ARGV[1])
|
|
|
|
|
|
|
|
|
|
b.get_category_articles("Kategorie:FIXME").each do |title|
|
|
|
|
|
|
|
|
|
|
# Diese Artikel ignorieren
|
|
|
|
|
next if title.match(/Benutzer:Neinomat/)
|
|
|
|
|
next if title == "Entropia:FIXME"
|
|
|
|
|
next if title == "Vorlage:FIXME"
|
|
|
|
|
|
|
|
|
|
# Diese Artikel <20>ndern
|
|
|
|
|
r = b.get_raw(title)
|
|
|
|
|
if r.match(/\[\[Kategorie:FIXME\]\]/)
|
|
|
|
|
r = "{{FIXME}}\n" + r.gsub(/\[\[Kategorie:FIXME\]\]\n?/, "")
|
|
|
|
|
b.edit(title, r, "s/Kategorie/Vorlage")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# Diese Artikel enthalten FIXME, aber nicht nur als Vorlage
|
|
|
|
|
if r.match(/[^{]FIXME/)
|
|
|
|
|
puts "* [[#{title}]]\n"
|
|
|
|
|
end
|
|
|
|
|
end
|