Created
April 3, 2015 22:27
-
-
Save abutcher/4abbb82de9dd3e1dc10c to your computer and use it in GitHub Desktop.
destiny cards from api
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
| #!/usr/bin/env ruby | |
| require 'json' | |
| require 'open-uri' | |
| # display_name = ARGV[0] | |
| # membership_id = JSON.load(open("https://www.bungie.net/platform/destiny/SearchDestinyPlayer/All/#{display_name}/"))["Response"][0]["membershipId"] | |
| # puts membership_id.to_s | |
| themes = JSON.load(open("http://www.bungie.net/Platform/Destiny/Vanguard/Grimoire/Definition/"))["Response"]["themeCollection"] | |
| themes.each do |theme| | |
| page_collections = theme["pageCollection"] | |
| page_collections.each do |page_collection| | |
| card_collections = page_collection["cardCollection"] | |
| card_collections.each do |card| | |
| if /Ghost Fragment/.match(card["cardName"]) | |
| puts "card_id: #{card["cardId"]}, card_name: #{card["cardName"]}" | |
| end | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment