Project

red_haze

0.0
No commit activity in last 3 years
No release in over 3 years
a robust Ruby wrapper for the Soundcloud API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0

Runtime

 Project Readme

red_haze - SoundCloud API gem

This is an unofficial Ruby gem for the Soundcloud API. It is OO and provides you with some nice objects with convenient methods. All "☁" links point to the official SoundCloud documenation for that object. Get hacking.

##Installation gem install red_haze or add gem 'red_haze' to your bundle file ##Configuration RedHaze must be configured before use. The following arguments can be provided to RedHaze.configure(<ARGS>)

Arguments Usage
client_id: <CLIENT_ID> General, unauthenticated calls. Minimum requirement
access_token: <ACCESS_TOKEN> Authenticated calls. Gives access to Me
client_id: <CLIENT_ID>,
client_secret: <CLIENT_SECRET>,
redirect_uri: <REDIRECT_URI>
Required when requested/refreshing access tokens (see below)

Alternatively, you can create a config.yml file (see the config.yml.template) to load a hash of these settings and use RedHaze.configure_from_file('<FILE_NAME>')

To sign up for a developer account and receive a client_id go here

###OAuth After configuring RedHaze with the required attributes, hit the RedHaze.authorize_url. At your redirect_uri, pass the code parameter to RedHaze.client.get_token_from_code(<CODE>) and you'll be ready to make authenticated requests.


##User Initialized via RedHaze.user(<USER_ID>).

Method Description
.followings Users this user is following
.followers Users following this user
.comments user's Comments
.tracks user's Tracks
.favorites user's favorite Tracks
.groups user's Groups
.playlists user's Playlists

##Me Requires valid access token. Subclass of User. Access via RedHaze.me.

Method Description
.activities Collection of dashboard activities
.follow!(arg) Follows a given User or user_id
.unfollow!(arg) Unfollows a given User or user_id
.follows?(arg) Checks if user follows a given User or user_id
.favorite!(arg) Favorites a given Track or track_id
.unfavorite!(arg) Unfavorites a given Track or track_id
.favorite?!(arg) Checks if user has favorited a given Track or track_id

##Track Access via RedHaze.track(<TRACK_ID>).

Method Description
.favoriters Users who have favorited track
.comments Comments on track
.shared_to Users who have access to the track

##Collection Wrapper object returned from Me#activities. Returns a group of activities contained within the items attribute. Use .next to retrieve the next paginated Collection.

##Activity Contained in collection. Links to an origin object.


##Group Access via RedHaze.group(<GROUP_ID>).

Method Description
.members Users who have joined group
.moderators Users who are moderators
.contributors Users who have contributed
.users All of the above

##Playlist Access via RedHaze.Playlist(<PLAYLIST_ID>).


##Comment Access via RedHaze.Comment(<COMMENT_ID>).


#Contributing

Contributions via Issue/Bug reporting, Feature Requests, and Pull requests are encouraged. Please write tests (integrated if possible) for new features.