neingeist
/
neinomaten
Archived
1
0
Fork 0
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.
neinomaten/neinomat-uebersichten

34 lines
1.1 KiB
Plaintext

19 years ago
#!/usr/bin/env ruby
18 years ago
$:.unshift('vendor/ruby-mediawiki/lib')
$:.unshift('vendor/htree')
require 'mediawiki/dotfile'
@wiki = MediaWiki.dotfile(nil,'entropia')
19 years ago
def check_page_against_category (page, category)
18 years ago
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"
19 years ago
a = @wiki.article("Benutzer:Neinomat/#{page}")
a.text = body
a.submit("wiki ex machina")
19 years ago
end
18 years ago
#----------------------------------------------------------------------------
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")