Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zquestz/starcraft2
Tiny sc2 api wrapper.
https://github.com/zquestz/starcraft2
Last synced: about 1 month ago
JSON representation
Tiny sc2 api wrapper.
- Host: GitHub
- URL: https://github.com/zquestz/starcraft2
- Owner: zquestz
- Created: 2013-08-07T00:45:15.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-09-27T05:13:44.000Z (over 11 years ago)
- Last Synced: 2024-10-14T10:11:20.519Z (3 months ago)
- Language: Ruby
- Size: 1.67 MB
- Stars: 4
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## starcraft2
A small StarCraft 2 API wrapper. For full documentation, visit https://github.com/Blizzard/api-sc2-docs.
## Installation
Add to your `Gemfile`:
```ruby
gem "starcraft2"
```Then `bundle install`.
## Usage
The Client class is the starting point for all calls made to the API. A full list of hosts and locales can be found in the API documentation above.
```ruby
client = Starcraft2::Client.new(:host => 'us.battle.net', :locale => 'en_US')
```### Profiles
`Starcraft2::Profile` contains all profile information. Realm, character name and id can all be found in a player's profile url.
```ruby
profile = client.profile(:realm => 1, :character_name => "Minigun", :id => 288081)
```**Call a player's league**
```ruby
profile.career.league
```**Fetch a profile's ladders**
```ruby
profile.ladders
```**Fetch a profile's recent matches**
```ruby
profile.matches
```### Game Info
**Fetch all achievements**
```ruby
client.achievements
```**Fetch all rewards**
```ruby
client.rewards
```### Authorization
If you require authorization then the changes are very simple. Just set the following two ENV variables.
```
STARCRAFT2_API_PRIVATE_KEY =
STARCRAFT2_API_PUBLIC_KEY =
```Once those are set, the gem will take care of the rest for you.
## Build Status
[![Build Status](https://travis-ci.org/zquestz/starcraft2.png)](https://travis-ci.org/zquestz/starcraft2)## License
Copyright (c) 2013 by Josh Ellithorpe, James Fickel, and Jan Hein Hoogstad
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.