ruby pastebin

Posted by Anonymous on Thu 3rd Dec 01:33 (modification of post by view diff)
download | new post

  1. agent = WWW::Mechanize.new
  2.  
  3. # login
  4. page = agent.get 'http://lania.de/utopia/index.php'
  5. form = page.forms.select { |form| form.action == "http://lania.de/utopia/index.php?action=login2" }.first
  6. form.user, form.passwrd = USERNAME, PASSWORD
  7. page = agent.submit form, form.buttons.first
  8.  
  9. # modify topic
  10. page = agent.get "http://lania.de/utopia/index.php?topic=#{TOPIC}"
  11. page = agent.click page.links.select { |link| link.text == 'Modify' }.first
  12. form = page.form 'postmodify'
  13. form.message = text
  14. page = agent.submit form, form.buttons.first

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.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


I'm Human
Remember me



Captcha required for posting