https://github.com/xarlybovi/halo-api
Wrapper for Halo Public API (BETA). https://developer.haloapi.com
https://github.com/xarlybovi/halo-api
api-wrapper gem halo ruby
Last synced: 8 months ago
JSON representation
Wrapper for Halo Public API (BETA). https://developer.haloapi.com
- Host: GitHub
- URL: https://github.com/xarlybovi/halo-api
- Owner: xarlybovi
- License: mit
- Created: 2017-09-02T11:17:14.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-08-06T16:11:53.000Z (almost 5 years ago)
- Last Synced: 2025-10-07T20:22:28.136Z (9 months ago)
- Topics: api-wrapper, gem, halo, ruby
- Language: Ruby
- Homepage:
- Size: 922 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# HaloAPI
[](https://badge.fury.io/rb/halo-api)
[](https://codeclimate.com/github/xarlybovi/halo-api)
[](https://github.com/xarlybovi/halo-api/actions)
[](https://codecov.io/gh/xarlybovi/halo-api)
Wrapper for Halo Public API (BETA). https://developer.haloapi.com
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'halo-api', '~> 1.0.0'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install halo-api
## Usage
Basic configuration:
````ruby
Halo.configure do |config|
config.api_key = ENV['HALO_API_KEY']
end
````
Configuration with redis and region (optional parameters)
````ruby
Halo.configure do |config|
config.api_key = ENV['HALO_API_KEY']
config.region = ENV['HALO_REGION'] # default 'en'
config.redis = ENV['HALO_REDIS']
config.ttl = ENV['HALO_TTL'] # default 1800
end
````
````ruby
halo5_client = Halo.halo5
# => Halo::Halo5
halo_wars2_client = Halo.halo_wars2
# => Halo::HaloWars2
h5_missions = halo5_client.metadata.campaign_missions
# => Array
h5_enemies = halo5_client.metadata.enemies
# => Array
h5_player_appearance = halo5_client.profile(player: 'xarly bovi').player_appearance
# => Array
hw2_campaign_levels = halo_wars2_client.metadata.campaign_levels
# => Array
hw2_seasons = halo_wars2_client.metadata.seasons
# => Array
````
## TODO
- [x] Halo 5 endpoints
- [x] Halo Wars 2 endpoints
- [x] Redis response caching support
- [ ] Request rate limiter
- [ ] Custom query builder
- [ ] Paged requests
- [ ] Documentation
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).