Skip to content

Instantly share code, notes, and snippets.

@rinx
Created May 11, 2013 03:04
Show Gist options
  • Select an option

  • Save rinx/5558747 to your computer and use it in GitHub Desktop.

Select an option

Save rinx/5558747 to your computer and use it in GitHub Desktop.
# -*- 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