Simple Ruby wrapper for the Soundcloud API.
This library contains two types of consumption. First there is the Soundcloud::Client (Simple Client), which offers the four basic methods to search the Soundcloud API via GROUPS, PLAYLISTS, TRACKS, and USERS. Then there are the subclass modules that extend more of the advanced API calls on the main 4 resources that Soundcloud offers. Here is a quick example of the Soundcloud::Client module notation:
client.users(:q => 'skrillex').first.city
=> "melbourne"
client.tracks(:q => 'A new world').first.permalink
=> "a-new-world"
The client should be instantiated with a single api_key that you can obtain from this url: http://soundcloud.com/you/apps/new Note the client is a quick way to consume and search the soundcloud API. More advanced methods can be found in the other subclassed modules.
client = Soundcloud::Client.new('YOUR_SOUNDCLOUD_API_KEY')
client.groups(:name => 'Field Recordings')
client.groups(:description => 'field recordings from across the world')
client.groups(:q => 'dubstep')
client.playlists(:title => 'Summer of 69', :sharing => 'public', :downloadable => 'false')
client.playlists(:q => 'crunk house')
client.tracks(:q => 'A New World', :bpm => 120)
client.tracks(:id => 1647583)
client.tracks(:genre => 'dubstep', :downloadable => true)
client.tracks(:genre => 'dubstep', :order => 'hotness')
client.users(:id => 47194613)
client.users(:city => 'greece', :description => 'badass')
client.users(:username => 'djzaxx')
c = Soundcloud::Comments.new('YOUR_SOUNDCLOUD_API_KEY')
c.comments('23145109')
g = Soundcloud::Groups.new('YOUR_SOUNDCLOUD_API_KEY')
g.groups('11440')
g.groups_moderators('11440')
g.groups_members('11440')
g.groups_contributors('11440')
g.groups_users('11440')
g.groups_tracks('11440')
p = Soundcloud::Playlists.new('YOUR_SOUNDCLOUD_API_KEY')
p.playlists('920731')
p.playlists_shared_to_users('4201929')
p.playlists_shared_to_emails('[email protected]')
t = Soundcloud::Tracks.new('YOUR_SOUNDCLOUD_API_KEY')
t.tracks('20296934')
t.tracks_comments('20296934')
t.tracks_comments('20296934', '23145109')
t.tracks_favoriters('20296934')
t.tracks_favoriters('20296934', '2769794')
t.tracks_shared_to_users('20296934')
t.tracks_shared_to_emails('20296934')
u = Soundcloud::Users.new('YOUR_SOUNDCLOUD_API_KEY')
u.user('4201929')
u.user_tracks('4201929')
u.user_playlists('4201929')
u.user_followings('4201929')
u.user_followings('4201929', '1931470')
u.user_followers('4201929')
u.user_followers('4201929', '1931470')
u.user_comments('4201929')
u.user_favorites('4201929')
u.user_favorites('4201929', '1931470')
u.user_groups('4201929')
$ bundle
$ rspec spec
None.
- Initial version
- Rebuilt the specs to test for nil objects
Faraday
REST clientHashie::Mash
Magic
- Fork the project.
- Make your feature addition or bug fix.
- Add tests for it. This is important so I don't break it in a future version unintentionally.
- Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
- Send me a pull request. Bonus points for topic branches.
Copyright (c) 2011 Alex Manelis.