shuffler_fm wraps's REST api on a thin layer of ruby.
Fetching latest commit…
Cannot retrieve the latest commit at this time.

ShufflerFM Build Status

Ruby API wrapper for v1 API


Add this line to your application's Gemfile:

gem 'shuffler_fm'

And then execute:

$ bundle

Or install it yourself as:

$ gem install shuffler_fm


Create an API instance

require 'shuffler_fm'

# Get and API key from
api = ShufflerFM.api('YOUR-KEY')
=> #<ShufflerFM::API:0x000000027fa2b8 @key="YOUR-KEY">

Read track data

# list tracks
tracks = api.tracks
=> [#<Hashie::Rash blog=#<Hashie::Rash about=\"\" channel_url=\"\" genres=[\"indie\", \"folk\", \"singer-songwriter\"] id=963 images=[#<Hashie::Rash height=240 url=\"\" width=240>] permalink=\"largehearted-boy\" profiles=#<Hashie::Rash facebook=nil twitter=nil> ...

# list operations are paginated
tracks = api.tracks(page: 2)

# request a particular track
track = api.track(1134715)
=> "Cover Freak"
=> ""

=> "Satisfaction"
=> "Bjork & PJ Harvey"

Search for an artist

=> ["Radiohead", "Radiohead at Lollapalooza 2008", "REM & Radiohead", "Radiohead 6. Permanent Daylight live", "Radiohead @ Optimus Alive'12", "I Can't Take The Hurt (Johnny Cash vs Tegan and Sarah and Radiohead)"]

Read a channel's activity stream

activity = []
api.genre_channels('punk', 'rock', page: 1, per_page: 10).each do |act|
  activity << "#{act.verb.capitalize} on #{} refering music track #{act.object.metadata.title}"

=> ["Post on The KEXP Blog refering music track Sunshine/Pretty Girls (Live on KEXP)",
    "Post on PropertyOfZack refering music track Always Summer (Live Video)",
    "Post on Nialler9 Music Blog refering music track Honningbarna (2012)",
    "Post on This Is Fake DIY refering music track Coffin Song", ...

and more ...


ShufflerFM.configure do |config|
  config.connection_timeout = 1 #seconds
  config.read_timeout       = 5 #seconds
  config.proxy              = { uri: '', user: 'user1', password: 'passwd'}


api = ShufflerFM.api("your-api-key", connection_timeout: 1, read_timeout: 5, proxy: '')


shuffler_fm reference


  1. Fork it
  2. Create your topic branch (git checkout -b my-topic-branch)
  3. Add/change specs for your unimplemented feature or bug fix
  4. Make sure specs fail by running bundle exec rake spec. If not return to step 3
  5. Hack it
  6. Make sure specs pass (bundle exec rake spec). If not return to step 5
  7. Edit the documentation so it is coherent with your feature or fix. Run bundle exec rake yard to review
  8. Commit changes (git commit -am 'Add some feature/fix') and push to the branch (git push origin my-topic-branch)
  9. Submit a pull request for your branch.


This API wrapper design is strongly influenced by the Ocktokit gem


Copyright (c) 2012 Miguel Guinada LICENSE for details. alpha