Put widgets on every page except the main one

This commit is contained in:
Alexander Yakovlev 2017-01-21 11:44:47 +07:00
parent 87ef12ca99
commit fe99d98226

View file

@ -6,12 +6,12 @@ config["sites"].each do |site|
wiki = Wiki.new(site["url"], site["username"], site["password"], config["dummy"])
list = wiki.get_list()['allpages']
for page in list do
page_text = wiki.get_text(page['title']).body.force_encoding("UTF-8")
changed = false
unless page_text.include?("[[Category:#{site["category"]}]]") || page_text.include?("[[קטגוריה:#{site["category"]}]]")
then
if page['title'] == 'Main Page' || page['title'] == 'עמוד ראשי' then
next
end
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
page_text = page_text + "\n\n<vote type=1 />"
changed = true