Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
libpafe-rubyで残高を取得し続けるだけのスクリプト
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
You can’t perform that action at this time.