Created
May 11, 2013 03:04
-
-
Save rinx/5558747 to your computer and use it in GitHub Desktop.
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
| # -*- coding: utf-8 -*- | |
| require 'nokogiri' | |
| require 'open-uri' | |
| # get prepaid balance | |
| # from https://mp.seikyou.jp/mypage/Static.init.do | |
| # | |
| # The MIT License | |
| # Copyright (c) 2013 @nepiadeath | |
| # | |
| # Please, fill id and pw. | |
| def get_prepaid | |
| usr_id = '' | |
| usr_pw = '' | |
| doc = Nokogiri::HTML(open("https://mp.seikyou.jp/mypage/Auth.login.do?loginId=#{usr_id}&password=#{usr_pw}")) | |
| usr_balance = doc.xpath('//div[@id="point_zandaka"]//td[@class="border_btm font_12 align_right def_color font_bold"]/span')[0].content | |
| usr_history = doc.xpath('//div[@id="point_zandaka"]//td[@class="font_12 align_right def_color"]')[0].content | |
| return "#{usr_history}のプリペイド残高: #{usr_balance}円" | |
| end | |
| puts get_prepaid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment