| #!/usr/bin/ruby
print "Content-type: text/html\n\n"
$stderr = $stdout
ENV['GEM_HOME']="/home/httpd/lightbox/public_html/gems"
$LOAD_PATH.push('/home/httpd/lightbox/public_html/lib')
require 'rubygems'
require 'mechanize'
print RUBY_VERSION,"\n"
agent = WWW::Mechanize.new
#mixiにログイン
page = agent.get("http://mixi.jp/")
form = page.forms.first
form["email"] = "メールアドレス"
form["password"] = "パスワード"
form.submit
#mixiエコーのページを取得
page = agent.get('http://mixi.jp/recent_echo.pl')
print page.body
| |