Skip to content

Instantly share code, notes, and snippets.

@tomohiro
Created October 28, 2009 05:04
Show Gist options
  • Save tomohiro/220254 to your computer and use it in GitHub Desktop.
Save tomohiro/220254 to your computer and use it in GitHub Desktop.
コマンドラインから mixi ボイスへ投稿ができるスクリプト
#!/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