Sha256: e341605d212806568ae211c7333afc0b9b0ade9785569b94ffc12749f01eec74
Contents?: true
Size: 870 Bytes
Versions: 2
Compression:
Stored size: 870 Bytes
Contents
#! /usr/bin/env ruby # # tsite.rb: getting current T-Point by scraping tsite.jp. # # Copyright (C) 2011 by TADA Tadashi <t@tdtds.jp> # Distributed under GPL. # require 'rubygems' require 'mechanize' require 'pit' URL = 'https://tsite.jp' @login = Pit::get( 'tsite', :require => { 'user' => 'your ID of tsite.jp.', 'pass' => 'your Password of tsite.jp.' } ) agent = Mechanize::new agent.set_proxy( *ENV['HTTP_PROXY'].split( /:/ ) ) if ENV['HTTP_PROXY'] agent.get( URL + '/tm/pc/login/STKIp0001001.do' ) agent.page.form_with( :name => 'form1' ) do |form| form.action = URL + '/tm/pc/login/STKIp0001010.do' form['LOGIN_ID'] = @login['user'] form['PASSWORD'] = @login['pass'] form.click_button end puts agent.page.at( 'p.point > span.number' ).text # Local Variables: # mode: ruby # indent-tabs-mode: t # tab-width: 3 # ruby-indent-level: 3 # End: # vim: ts=3
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
points-scraper-0.0.3 | bin/points-tpoint |
points-scraper-0.0.1 | bin/points-tpoint |