A simple ruby interface to the Soundreef API
This library provides a simple interface around the Songs, Batches and Earnings endpoints in the Soundreef API
Add this line to your application's Gemfile:
gem 'soundreef'
And then execute:
$ bundle
Or install it yourself as:
$ gem install soundreef
For Rails, just put this in an initializer.
Soundreef.configure do |c|
c.public_key = 'yourpublickey'
c.private_key = 'yourprivatekey'
end
Currently, Songs, Batches and Earnings endpoints are supported.
The Songs endpoint provides two interfaces: list and get.
List Params
- batch_id default = nil (optional)
- page default = 1 (optional)
- per_page default = 50 (optional)
- status default = nil (optional)
Examples
>> response = Soundreef::Songs.list({:page => 2, :per_page => 100})
>> response.keys
=> ["page", "per_page", "pages", "songs"]
>> response.songs.count
=> 100
>> response.songs.first
=> #<Hashie::Mash artist="SOME ARTIST NAME" batch=547 created_date="2012-10-30 17:54:36" song_guid="de6f5208-22ba-11e2-b5a9-12313c0866d9" song_supplier_id=132013 status=3 title="SOME SONG NAME">
Get Params
- song_guid (required if song_supplier_id is nil)
- song_supplier_id (required if song_guid is nil)
Examples
>> response = Soundreef::Songs.get({:song_guid => 'de6f5208-22ba-11e2-b5a9-12313c0866d9'})
=> #<Hashie::Mash artist="SOME ARTIST NAME" batch=547 created_date="2012-10-30 17:54:36" song_guid="de6f5208-22ba-11e2-b5a9-12313c0866d9" song_supplier_id=132013 status=3 title="SOME SONG NAME">
>> response.keys
=> ["title", "artist", "batch", "created_date", "song_guid", "song_supplier_id", "status"]
The Batches endpoint provides two interfaces: list and get.
List Params
- batch_id default = nil (optional)
- page default = 1 (optional)
- per_page default = 50 (optional)
- status default = nil (optional)
Examples
>> response = Soundreef::Batches.list({:per_page => 25})
>> response.keys
=> ["page", "per_page", "pages", "batches"]
>> response.batches.count
=> 19
>> response.batches.first
=> #<Hashie::Mash batch_id=583 created_date="2012-11-07 12:39:59" name="fofo" progress=1>
Get Params
- batch_id (required)
Examples
...
The Earnings endpoint provides two interfaces: list and get.
List Params
- song_guid (optional)
- year (required)
- semester (required)
- page (optional)
Examples
>> response = Soundreef::Earnings.list({:page => 2, :per_page => 100})
>> response.keys
=> ["page", "per_page", "pages", "songs"]
>> response.songs.count
=> 100
Get Params
- song_guid (required if song_supplier_id is nil)
- song_supplier_id (required if song_guid is nil)
- year default = nil (optional)
- semester default = nil (optional)
- from_date default = nil (optional)
- to_date default = nil (optional)
Examples
...
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Added some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request


