Created
September 5, 2013 14:22
-
-
Save Akkiesoft/6450764 to your computer and use it in GitHub Desktop.
libpafe-rubyで残高を取得し続けるだけのスクリプト
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
require "pasori" | |
pasori = Pasori.open | |
begin | |
begin | |
felica = pasori.felica_polling(Felica::POLLING_ANY) | |
felica.foreach(Felica::SERVICE_SUICA_HISTORY) {|l| | |
data = l.unpack('CCnnCCCCvN') | |
print "#{data[8]}\n" | |
break; | |
} | |
sleep 5 | |
rescue => ee | |
sleep 1 | |
end while true | |
rescue Interrupt | |
felica.close | |
pasori.close | |
exit 1 | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment