Skip to content

alexanderbez/sounddrop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SoundDrop

Gem Version

A gem that exposes various track information about a Soundcloud song by providing a URL. This gem is very limited in comparison to the original soundcloud API gem and provides no real advantage other than getting a media download URL.

Installation

Add this line to your application's Gemfile:

gem 'sounddrop'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sounddrop

Usage

Being that we're only considering crude track information, there really is no need to do any sort of user authentication. All you really need is a CLIENT_ID and CLIENT_SECRET.

How to get said keys? Easy! Head over to the [Soundcloud developers site] (developers.soundcloud.com) and register your application!

Everything is accessed via a Drop object which is created using a Client object.

client = SoundDrop::Client.new(
  client_id: CLIENT_ID,
  client_secret: CLIENT_SECRET
  ) #=> SoundDrop::Client

You can also specify :username and :password if you'd like.

Now for getting track information:

track_url = 'https://soundcloud.com/armadacaptivating/id-everytime-you-smile'
drop = client.get_drop(track_url) #=> SoundDrop::Drop

Let's get some useful data:

id = drop.id #=> Gets the track id
title = drop.title #=> Gets the track title
genre = drop.genre #=> Gets the track genre
media_url = drop.media_url #=> Gets the track download URL

Contributing

  1. Fork it ( https://github.com/Alexanderbez/sounddrop/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

A gem that provides audio and track information about a soundcloud song given a URL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages