22 lines
590 B
Ruby
Executable file
22 lines
590 B
Ruby
Executable file
#!/usr/bin/ruby
|
|
require './Wiki.rb'
|
|
|
|
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"])
|
|
list = wiki.get_list()['allpages']
|
|
for page in list do
|
|
if page['title'] == 'Main Page' || page['title'] == 'עמוד ראשי' then
|
|
next
|
|
end
|
|
puts page['title']
|
|
page_text = wiki.get_text(page['title'])
|
|
puts page_text
|
|
exit # TODO - REMOVE
|
|
changed = false
|
|
if changed then
|
|
wiki.create_page(page['title'], page_text)
|
|
end
|
|
end
|
|
end
|