Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
TinySong Ruby library.
Ruby
branch: master

This branch is 7 commits ahead, 8 commits behind grooveshark:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib adding README
spec
.gitignore
Gemfile
README.rdoc
Rakefile
tinysong.gemspec
watchr_suite.rb

README.rdoc

TinySong Ruby Library

TinySong is a quick way to share songs through Facebook, Twitter, email or just about anywhere. Think of it as a TinyURL for songs. Powered by Grooveshark.

In a nutshell:

# Return a URL string with the first search result (like Google's "I'm Feeling Lucky" button).
TinySong.first('Bad Brains')  # => "http://tinysong.com/2Z5Q"

# Returns a hash of meta information about the first song found.
TinySong.meta('Bad Brains')
# => {
  "Url" => "http://tinysong.com/2Z5Q",
  "SongID" => 8417130,
  "SongName" => "Banned in D.C.",
  "ArtistID" => 3419,
  "ArtistName" => "Bad Brains",
  "AlbumID" => 255086,
  "AlbumName" => "Bad Brains"
}

# Perform a search, returning an array of result hashes, in the same format as returned by TinySong.meta().
# Can pass an optional limit as the 2nd arg; default limit is 5, max is (currently) 32.
TinySong.search('Bad Brains', 3)
# => [
  { "Url" => "http://tinysong.com/2Z5Q", ... },
  { "Url" => "http://tinysong.com/gRqG", ... },
  { "Url" => "http://tinysong.com/1vPh", ... }
]
Something went wrong with that request. Please try again.