Latest changes
This commit is contained in:
parent
ed2d9c68bd
commit
93c56fdb84
2
start.rb
2
start.rb
|
@ -1,6 +1,8 @@
|
||||||
#!/usr/bin/ruby
|
#!/usr/bin/ruby
|
||||||
require './Wiki.rb'
|
require './Wiki.rb'
|
||||||
|
|
||||||
|
#TODO: don't tag the category pages and redirects
|
||||||
|
|
||||||
config = YAML::load_file(File.join(__dir__, 'config.yaml'))
|
config = YAML::load_file(File.join(__dir__, 'config.yaml'))
|
||||||
config["sites"].each do |site|
|
config["sites"].each do |site|
|
||||||
wiki = Wiki.new(site["url"], site["username"], site["password"], config["dummy"])
|
wiki = Wiki.new(site["url"], site["username"], site["password"], config["dummy"])
|
||||||
|
|
13
undo.rb
13
undo.rb
|
@ -2,10 +2,14 @@
|
||||||
require './Wiki.rb'
|
require './Wiki.rb'
|
||||||
|
|
||||||
def rollback(wiki, title)
|
def rollback(wiki, title)
|
||||||
wiki.client.action :rollback,
|
begin
|
||||||
title: title,
|
wiki.client.action :rollback,
|
||||||
token_type: :rollback,
|
title: title,
|
||||||
user: 'Enadmin'
|
token_type: :rollback,
|
||||||
|
user: 'Enadmin'
|
||||||
|
rescue
|
||||||
|
puts title
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
config = YAML::load_file(File.join(__dir__, 'config.yaml'))
|
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
|
if page['title'] == 'Main Page' || page['title'] == 'עמוד ראשי' then
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
puts page['title']
|
|
||||||
page_text = wiki.get_text(page['title'])
|
page_text = wiki.get_text(page['title'])
|
||||||
if page_text.match('<!DOCTYPE html>')
|
if page_text.match('<!DOCTYPE html>')
|
||||||
rollback(wiki, page['title'])
|
rollback(wiki, page['title'])
|
||||||
|
|
Loading…
Reference in a new issue