Posted by Anonymous on Wed 2nd Dec 22:51 (modification of post by view diff)
download | new post
- def forum(text)
- agent = WWW::Mechanize.new
- # login
- page = agent.get @forum['url']
- form = page.forms.select { |form| form.action == "#{@forum['url']}?action=login2" }.first
- form.user, form.passwrd = @forum['username'], @forum['password']
- page = agent.submit form, form.buttons.first
- # modify topic
- page = agent.get "#{@forum['url']}?topic=#{@forum['id']}"
- page = agent.click page.links.select { |link| link.text == 'Modify' }.first
- form = page.form 'postmodify'
- if form.message == text
- return :unchanged
- end
- form.message = text
- page = agent.submit form, form.buttons.first
- return :success
- end
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.