1
0
Fork 0
This repository has been archived on 2019-12-19. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
neinomaten/neinomat-uebersichten

34 lines
1.1 KiB
Text
Raw Normal View History

2005-10-01 16:26:34 +00:00
#!/usr/bin/env ruby
2006-04-17 14:59:44 +00:00
$:.unshift('vendor/ruby-mediawiki/lib')
$:.unshift('vendor/htree')
require 'mediawiki/dotfile'
@wiki = MediaWiki.dotfile(nil,'entropia')
2005-10-01 16:26:34 +00:00
2006-04-17 20:51:17 +00:00
def check_page_against_category (page, category)
2006-04-17 14:59:44 +00:00
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"
2005-10-01 16:26:34 +00:00
2006-04-17 20:51:17 +00:00
a = @wiki.article("Benutzer:Neinomat/#{page}")
a.text = body
a.submit("wiki ex machina")
2005-10-02 21:09:17 +00:00
end
2006-04-17 14:59:44 +00:00
#----------------------------------------------------------------------------
2006-04-17 20:51:17 +00:00
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")