From dea4fb4b91eb2bcece7fce1c048562e209c1086e Mon Sep 17 00:00:00 2001 From: neingeist Date: Wed, 21 Jun 2006 16:50:41 +0000 Subject: [PATCH] Interwiki foo --- neinomat-interwiki | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 neinomat-interwiki diff --git a/neinomat-interwiki b/neinomat-interwiki new file mode 100755 index 0000000..433d227 --- /dev/null +++ b/neinomat-interwiki @@ -0,0 +1,23 @@ +#!/usr/bin/env ruby +$:.unshift('vendor/ruby-mediawiki/lib') +$:.unshift('vendor/htree') +require 'mediawiki/dotfile' +@wiki = MediaWiki.dotfile(nil,'entropia') +@putwhere = "Benutzer:Neinomat/" +@body = "" + +@wiki.allpages.each do |title| + MediaWiki::logger.debug("Checking #{title}") + text = @wiki.article(title).text + s = text.scan(/^.*wikipedia.org.*$/s) + if s != [] + @body += "* [[#{title}]]\n" + s.each do |m| + @body += "
#{m}
\n" + end + end +end + +a = @wiki.article(@putwhere + "Interwiki links that need to be interwikified") +a.text = @body +a.submit("fnord")