Created
June 24, 2009 12:11
-
-
Save mccxj/135212 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blogbus_login = 'http://www.blogbus.com/' | |
blogs = 'http://www.blogbus.com/user/?blogid=1477842&mm=Post&aa=Index&page=' | |
require 'rubygems' | |
require 'mechanize' | |
agent = WWW::Mechanize.new | |
page = agent.get(blogbus_login) | |
form = page.form('frmLogin') | |
form.username="mccxj" | |
form.password="my_private_password" | |
form.checkbox_with(:name => 'remember').check | |
page = agent.submit(form, form.buttons.first) | |
(1..50).each do |i| | |
page = agent.get(blogs + i.to_s) | |
page.links.each do |l| | |
if l.href =~ /blogid=1477842&mm=Post&aa=Edit/ | |
p l.href | |
edit_page = agent.click l | |
edit_form = edit_page.form("EditorForm") | |
agent.submit(edit_form) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment