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
|
|
|
|
$:.unshift('vendor/ruby-mediawiki/lib')
|
|
|
|
$:.unshift('vendor/htree')
|
|
|
|
require 'mediawiki/dotfile'
|
|
|
|
@wiki = MediaWiki.dotfile(nil,'entropia')
|
|
|
|
|
|
|
|
def check_page_against_category (page, category)
|
|
|
|
body = "== #{page} ==\n\n"
|
|
|
|
body += "[[Category:FIXME]]\n\n"
|
|
|
|
body += "Unter [[#{page}]] fehlen folgende Artikel aus [[:#{category}]]:\n\n"
|
|
|
|
|
|
|
|
count = 0
|
|
|
|
page_html = @wiki.article(page).xhtml.to_s
|
|
|
|
@wiki.category(category).articles.each do |title|
|
|
|
|
re = Regexp.new(Regexp.escape("title='" + CGI.escapeHTML(title)))
|
|
|
|
if ! re.match(page_html) && title != page
|
|
|
|
body += "* [[" + title + "]]\n"
|
|
|
|
count += 1
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
body += "\n#{count} Artikel.\n"
|
|
|
|
|
|
|
|
a = @wiki.article("Benutzer:Neinomat/#{page}")
|
|
|
|
a.text = body
|
|
|
|
a.submit("wiki ex machina")
|
|
|
|
end
|
|
|
|
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
check_page_against_category("Übersicht über Vorträge", "Kategorie:Vorträge")
|
|
|
|
check_page_against_category("Übersicht über Projekte", "Kategorie:Projekte")
|
|
|
|
check_page_against_category("Entropia:FIXME", "Kategorie:FIXME")
|