swordfish6975 / battlenet-api

Simple API Wrapper for the New BattleNet APIs ( https://dev.battle.net/ )

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Battlenet API Gem

Gem Version Dependency Status Code Climate

Installation

$ gem install battlenet-api

How to Use

Configuration

Battlenet.configure do |config|
  config.api_key = 'apikey'
  config.region  = :us
end

World of Warcraft Client

client = Battlenet.WOWClient

achievement = client.achievement({:achievement => 'achievement_id'})
auction_data = client.auction({:realm => 'realm'})
character = client.character_profile({:realm => 'realm', :character_name => 'character_name'})

# TODO: character methods

guild = client.guild_profile({:realm => 'realm', :guild_name => 'guild_name'})

# TODO: guild methods

data = client.data

# TODO: data methods

item = client.item({:item => 'item_id'})
puts item.details

item = client.item_set({:item_set => 'item_set_id'})
puts item.details

pvp_leaderboards = client.pvp_leaderboards({:bracket => 'bracket'})
puts pvp_leaderboards.details

quest = client.quest({:quest => 'quest_id'})
puts quest.details

recipe = client.recipe({:recipe => 'recipe_id'})
puts recipe.details

spell = client.spell({:spell => 'spell_id'})
puts spell.details

Diablo 3 Client

client = Battlenet.D3Client

#Available Methods

client.data_item(data_id)
client.data_follower(follower_id)
client.data_artisan(artisan_id)

client.career_profile(battletag)
client.hero_profile(battletag,hero_id)

Starcraft 2 Client

client = Battlenet.S2Client

#Available Methods

client.achievements
client.rewards

client.ladder(ladder_id)

client.profile(id, region, name)
client.profile_ladders(id, region, name)
client.profile_match_history(id, region, name)

TODO

  • Community OAuth Profile APIs

  • Account APIs

  • Unit Tests for All APIs

  • Refactor Client Code to Utilize OpenStruct on JSON Responses

About

Simple API Wrapper for the New BattleNet APIs ( https://dev.battle.net/ )

License:MIT License


Languages

Language:Ruby 100.0%