This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
ruby-mtv /
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Tue Sep 16 13:33:41 -0700 2008 | |
| |
README | Sat Nov 15 20:41:51 -0800 2008 | |
| |
Rakefile | Tue Oct 28 13:57:21 -0700 2008 | |
| |
TODO | Sat Nov 15 20:41:51 -0800 2008 | |
| |
init.rb | Mon Oct 27 11:03:30 -0700 2008 | |
| |
lib/ | Sat Nov 15 20:33:35 -0800 2008 | |
| |
ruby-mtv.gemspec | Fri Oct 31 13:35:10 -0700 2008 | |
| |
test/ | Sat Nov 15 20:41:51 -0800 2008 |
README
ruby-mtv
by Tieg Zaharia
http://github.com/tiegz/ruby-mtv
== DESCRIPTION:
This is a Ruby library for the MTV Networks api. Right now it has classes for Artists, Videos and Genres,
although there is much to be done! It currently parses the default ATOM response format.
== REQUIREMENTS:
* ActiveSupport
* Hpricot
== INSTALL:
$ gem sources -a http://gems.github.com/ (you only need to do this once)
$ gem install tiegz-ruby-mtv
== USAGE:
Require the gem...
require 'tiegz-ruby-mtv'
To find an artist,
artist = MTV::Artist.search('dinosaur jr').first
# => #<MTV::Artist name: "Dinosaur Jr.", uid: "dinosaur_jr", uri: "http://api.mtvnservices.com/1/artist/dinosaur_jr/">
To find related artists,
artist.related
# => [#<MTV::Artist name: "Afghan Whigs", uid: "afghan_whigs", uri:
"http://api.mtvnservices.com/1/artist/afghan_whigs/">,
#<MTV::Artist name: "The Breeders", uid: "breeders", uri: "http://api.mtvnservices.com/1/artist/breeders/">, ...
]
To find a video,
video = MTV::Video.search('dinosaur jr').first
# => #<MTV::Video title: "Been There All the Time", uid: "hznHivqrbHHDAXBAZ", artist_name: "Dinosaur Jr.",
uri: "http://api.mtvnservices.com/1/video/hznHivqrbHHDAXB...",
artist_uri: "http://api.mtvnservices.com/1/artist/dinosaur_jr/">
v.artist
# => #<MTV::Artist name: "Dinosaur Jr.", uid: "dinosaur_jr", uri: "http://api.mtvnservices.com/1/artist/dinosaur_jr/">
To get html embed markup for the video swf,
v.embed_code(:width => 200)
# => "<embed src=\"http://media.mtvnservices.com/mgid:uma:video:api.mtvnservices.com:143042\"
type=\"application/x-shockwave-flash\" width=\"200\" height=\"163\"
allowFullScreen=\"true\" allowScriptAccess=\"always\" />"
To find all videos for an artist,
artist.videos
# => [#<MTV::Video title: ["Been There All the Time"], uid: "hznHivqrbHHDAXBAZ", artist_name: ["Dinosaur Jr."] ...>,
... ]
== RELEVANT LINKS
MTVN api docs: http://developer.mtvnservices.com/docs







