Fix for match regexes
This commit is contained in:
parent
e015f90252
commit
08363fdb74
3
start.rb
3
start.rb
|
@ -1,12 +1,11 @@
|
|||
#!/usr/bin/ruby
|
||||
require 'pp'
|
||||
require './Wiki.rb'
|
||||
|
||||
wiki = Wiki.new
|
||||
list = wiki.get_list()['allpages']
|
||||
for page in list do
|
||||
page_text = wiki.get_text(page['title']).body
|
||||
if page_text.match("[[Category:Jokes]]") and not page_text.match("<vote type=1 />") then
|
||||
if page_text.match(/\[\[Category\:Jokes\]\]/) and not page_text.match(/<vote type=1 \/>/) then
|
||||
page_text = page_text + "\n\n<vote type=1 />"
|
||||
wiki.create_page(page['title'], page_text)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue