Created
April 24, 2014 16:44
-
-
Save sue445/11261261 to your computer and use it in GitHub Desktop.
juneat plusの楽曲jsonをparseするサンプルコード
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
require "open-uri" | |
require "json" | |
require 'pp' | |
MUSIC_LIST_URL = "http://www.konami.jp/jubeatplus/music/index.php5" | |
html = open(MUSIC_LIST_URL).read | |
html =~ /global.packJson\s*=\s*(.+);/ | |
json = $1 | |
packs = JSON.parse(json) | |
licence_packs = packs["License"] | |
konami_packs = packs["Konami"] | |
# それぞれ最新の曲のみ表示 | |
pp licence_packs.first | |
pp konami_packs.first |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
出力結果
License
Konami