neingeist
/
neinomaten
Archived
1
0
Fork 0

rausgekratztes html unescapen

master
neingeist 19 years ago
parent 20823077c6
commit d75a197ac5

@ -2,10 +2,9 @@
module MediaWikiBot module MediaWikiBot
require 'http-access2' require 'cgi'
require 'erb' require 'erb'
require 'parsedate' require 'http-access2'
include ParseDate
class WikiBot class WikiBot
@ -84,7 +83,7 @@ class WikiBot
allpages_page = @client.get_content(@wiki + "Special:Allpages") allpages_page = @client.get_content(@wiki + "Special:Allpages")
allpages_page.scan(/title="(.*?)"/) do |m| allpages_page.scan(/title="(.*?)"/) do |m|
title = m[0] title = CGI.unescapeHTML(m[0])
allpages.push(title) allpages.push(title)
end end
@ -103,7 +102,7 @@ class WikiBot
what_links_here_page = @client.get_content(url_what_links_here(title)) what_links_here_page = @client.get_content(url_what_links_here(title))
what_links_here_page.scan(/<li><a href=".*?" title="(.*?)"/) do |m| what_links_here_page.scan(/<li><a href=".*?" title="(.*?)"/) do |m|
title = m[0] title = CGI.unescapeHTML(m[0])
what_links_here.push(title) what_links_here.push(title)
end end
@ -188,7 +187,7 @@ class WikiBot
category_page = @client.get_content(@wiki + url_encode(category)) category_page = @client.get_content(@wiki + url_encode(category))
category_page.scan(/<li><a href=".*?" title="(.*?)"/) do |m| category_page.scan(/<li><a href=".*?" title="(.*?)"/) do |m|
title = m[0] title = CGI.unescapeHTML(m[0])
articles.push(title) articles.push(title)
end end