Created
October 28, 2009 05:04
-
-
Save tomohiro/220254 to your computer and use it in GitHub Desktop.
コマンドラインから mixi ボイスへ投稿ができるスクリプト
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'uri' | |
require 'mechanize' | |
agent = WWW::Mechanize.new | |
if ENV['http_proxy'] | |
proxy = URI.parse(ENV['http_proxy']) | |
agent.set_proxy(proxy.host, proxy.port) | |
end | |
email = 'your_mixi_email' | |
password = 'your_mixi_password' | |
agent.get 'http://mixi.jp' do |login_page| | |
login_page.form 'login_form' do |form| | |
form.email = email | |
form.password = password | |
end.submit | |
end | |
agent.get 'http://mixi.jp/recent_echo.pl' do |post_page| | |
post_page.form_with(:action => 'add_echo.pl') do |form| | |
form.body = ARGV.first | |
end.submit | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment