{"id":17239187,"url":"https://github.com/binarymuse/battlenet","last_synced_at":"2025-08-20T09:30:34.577Z","repository":{"id":55086895,"uuid":"1616617","full_name":"BinaryMuse/battlenet","owner":"BinaryMuse","description":"Easily consume Blizzard's Community Platform API.","archived":false,"fork":false,"pushed_at":"2023-01-03T16:13:58.000Z","size":506,"stargazers_count":56,"open_issues_count":7,"forks_count":15,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-12-16T07:11:23.540Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://us.battle.net/wow/en/forum/topic/2369881371#1","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BinaryMuse.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-04-14T22:42:38.000Z","updated_at":"2024-10-22T22:40:44.000Z","dependencies_parsed_at":"2023-02-01T07:45:24.787Z","dependency_job_id":null,"html_url":"https://github.com/BinaryMuse/battlenet","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryMuse%2Fbattlenet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryMuse%2Fbattlenet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryMuse%2Fbattlenet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryMuse%2Fbattlenet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BinaryMuse","download_url":"https://codeload.github.com/BinaryMuse/battlenet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230408171,"owners_count":18220974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T05:47:59.813Z","updated_at":"2024-12-19T09:08:15.913Z","avatar_url":"https://github.com/BinaryMuse.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"        __ )          |    |    |                     |\n        __ \\    _` |  __|  __|  |   _ \\  __ \\    _ \\  __|\n        |   |  (   |  |    |    |   __/  |   |   __/  |\n       ____/  \\__,_| \\__| \\__| _| \\___| _|  _| \\___| \\__|\n\n    A Ruby library for the Battle.net Community Platform API\n\n[![Build Status](https://secure.travis-ci.org/BinaryMuse/battlenet.png)](http://travis-ci.org/BinaryMuse/battlenet)\n\nBattlenet is a Ruby library that exposes Blizzard's [Community Platform API](http://us.battle.net/wow/en/forum/topic/2369881371).\n\nInstalling\n==========\n\nBattlenet is available as a Ruby gem. Install it via\n\n    [sudo] gem install battlenet\n\nUse\n===\n\nSimply create an instance of `Battlenet`, passing in an optional region as a symbol (defaulting to US), and then optionally a public and private key (for app authorization).\n\nDefault options:\n\n    api = Battlenet.new\n\nSpecifying a region:\n\n    api = Battlenet.new :eu\n\nSpecifying a public and private key:\n\n    api = Battlenet.new :us, 'public', 'private'\n\nBattlenet is backed by the excellent [HTTParty gem](https://github.com/jnunemaker/httparty), which means you can make get requests very simply.\n\n    api.get '/item/12784'\n\nBattlenet also provides modules for each section of the API, providing easy access to the resources.\n\n    api.item '12784'\n    api.character 'Nazjatar', 'Cyaga', :fields =\u003e \"stats,talents,quests\"\n\nConfiguring\n===========\n\nFailing Silently\n----------------\n\nBy default, if Battlenet receives a 4xx or 5xx response from the Battle.net API, it will throw a `Battlent::ApiException`. You can turn this behavior off via the `fail_silently` attribute:\n\n    Battlenet.fail_silently = true\n\nThe exception will have its `code` attribute set to the HTTP status code returned from the API; if the response included a JSON response with the `reason` field set, the exception will have a `reason` attribute set to this string. You can also access the raw response via the `response` attribute.\n\nLocalization\n------------\n\nThe Battle.net API supports localization via a query string parameter. Battlenet can transparently handle setting this parameter for you on every request. Just set the `locale` attribute:\n\n    Battlenet.locale = \"en_GB\"\n\nPlease note that each region only supports certain locales.\n\nBattle.net API Documentation\n============================\n\nThe documentation for the Battle.net API can be found at http://blizzard.github.com/api-wow-docs/.\n\nWhat's Missing\n==============\n\nThe following features are planned but not yet supported:\n\n  * Caching support via Memcached, Redis, etc.\n  * If-Last-Modified header support\n\nContributing\n============\n\nIf you would like to contribute to the project, please feel free to do so. Just fork the project, commit your changes (preferably to a new branch), and then send me a pull request via GitHub. Be sure to add tests for your feature or fix.\n\nPlease do not change the contents of the `VERSION` file, or if you do, do so in a separate commit so that I can cherry-pick around it.\n\nSetting Up the Development Environment\n--------------------------------------\n\nThe development environment is managed with Bundler.\n\nTo install just the gems you need to hack on Battlenet and run the specs, run\n\n    bundle install --without documentation\n\nTo install all development gems, including the ones used to generate documentation, run\n\n    bundle install\n\nTo run the specs, run\n\n    bundle exec rake\n\nWriting an Integration Test\n---------------------------\n\nHigh-level integration testing against the Community Platform API is handled via VCR. After the first time running a spec that hits the API, VCR saves the HTTP response in a fixture file and uses this file to run against in the future.\n\nHere's an example (the character integration specs):\n\n    it \"fetches character data\" do\n      VCR.use_cassette('character_mortawa') do\n        character = api.character 'nazjatar', 'mortawa'\n        character['level'].should == 85\n      end\n    end\n\n    it \"fetches additional character data\" do\n      VCR.use_cassette('character_mortawa_titles') do\n        character = api.character 'nazjatar', 'mortawa', :fields =\u003e 'titles'\n        character['titles'].find { |t| t['selected'] == true }['name'].should == \"Twilight Vanquisher %s\"\n      end\n    end\n\n    it \"fetches characters with non-ASCII characters in their name\" do\n      VCR.use_cassette('character_nonstandard_name') do\n        character = api.character 'nazjatar', 'Hikô'\n        character['level'].should == 85\n      end\n    end\n\nYou should always wrap tests that hit the actual API in the `VCR.use_cassette` block, and the resulting fixture file should be checked in with your test.\n\nBuilding the Documentation\n--------------------------\n\nIf you have the necessary gems installed (defined in the `documentation` group in the Gemfile), you can easily generate the documentation via\n\n    yard\n\nThe generated documentation can be found in `doc/`; open `doc/index.html` to view it.\n\nLicense\n=======\n\nBattlenet is released under the MIT license.\n\n    Copyright (c) 2011 Brandon Tilley\n\n    Permission is hereby granted, free of charge, to any person\n    obtaining a copy of this software and associated documentation\n    files (the \"Software\"), to deal in the Software without\n    restriction, including without limitation the rights to use,\n    copy, modify, merge, publish, distribute, sublicense, and/or sell\n    copies of the Software, and to permit persons to whom the\n    Software is furnished to do so, subject to the following\n    conditions:\n\n    The above copyright notice and this permission notice shall be\n    included in all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n    OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinarymuse%2Fbattlenet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinarymuse%2Fbattlenet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinarymuse%2Fbattlenet/lists"}