From 93c56fdb846c7892c5aafe194236469073fdd9d3 Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Sun, 5 Mar 2017 14:16:32 +0700 Subject: [PATCH] Latest changes --- start.rb | 2 ++ undo.rb | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/start.rb b/start.rb index 5ef8b76..9df2285 100755 --- a/start.rb +++ b/start.rb @@ -1,6 +1,8 @@ #!/usr/bin/ruby require './Wiki.rb' +#TODO: don't tag the category pages and redirects + config = YAML::load_file(File.join(__dir__, 'config.yaml')) config["sites"].each do |site| wiki = Wiki.new(site["url"], site["username"], site["password"], config["dummy"]) diff --git a/undo.rb b/undo.rb index 77a1c45..cbbf8c1 100755 --- a/undo.rb +++ b/undo.rb @@ -2,10 +2,14 @@ require './Wiki.rb' def rollback(wiki, title) - wiki.client.action :rollback, - title: title, - token_type: :rollback, - user: 'Enadmin' + begin + wiki.client.action :rollback, + title: title, + token_type: :rollback, + user: 'Enadmin' + rescue + puts title + end end config = YAML::load_file(File.join(__dir__, 'config.yaml')) @@ -16,7 +20,6 @@ config["sites"].each do |site| if page['title'] == 'Main Page' || page['title'] == 'עמוד ראשי' then next end - puts page['title'] page_text = wiki.get_text(page['title']) if page_text.match('') rollback(wiki, page['title'])