Created
December 26, 2013 08:35
-
-
Save ktnyt/8131300 to your computer and use it in GitHub Desktop.
Parsing bus api output with ruby
This file contains 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
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'uri' | |
require 'json' | |
url = 'http://hack.sfc.keioac.jp/sfcbusapi/index.php' | |
uri = URI.parse( url ) | |
res = Net::HTTP.get( uri ) | |
m = /^callback\((.+)\);$/.match( res ) | |
data = JSON.parse( m[1] ) | |
puts data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment