Skip to content

Instantly share code, notes, and snippets.

@Akkiesoft
Created September 5, 2013 14:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Akkiesoft/6450764 to your computer and use it in GitHub Desktop.
Save Akkiesoft/6450764 to your computer and use it in GitHub Desktop.
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