don't put voting widgets on redirect pages

This commit is contained in:
Alexander Yakovlev 2017-03-05 14:23:42 +07:00
parent 93c56fdb84
commit 69b03a4361

View file

@ -14,11 +14,15 @@ config["sites"].each do |site|
puts page['title']
page_text = wiki.get_text(page['title']).body.force_encoding("UTF-8")
changed = false
if not page_text.include?("<vote type=1 />") then
if not page_text.include?("<vote type=1 />") and
not page_text.include("REDIRECT")
then
page_text = page_text + "\n\n<vote type=1 />"
changed = true
end
if not page_text.include?("<iusethis />") then
if not page_text.include?("<iusethis />") and
not page_text.include("REDIRECT")
then
page_text = page_text + "\n\n<iusethis />"
changed = true
end