public
Description: A Ruby library for the newly borne MTV Networks api.
Homepage:
Clone URL: git://github.com/tiegz/ruby-mtv.git
name age message
file MIT-LICENSE Tue Sep 16 13:33:41 -0700 2008 rename LICENSE to MIT-LICENSE [tiegz]
file README Sat Nov 15 20:41:51 -0800 2008 updated TODOs and took out commented stuff in g... [tiegz]
file Rakefile Tue Oct 28 13:57:21 -0700 2008 added a default rake test task [tiegz]
file TODO Sat Nov 15 20:41:51 -0800 2008 updated TODOs and took out commented stuff in g... [tiegz]
file init.rb Mon Oct 27 11:03:30 -0700 2008 rearranged files and organized each class into ... [tiegz]
directory lib/ Sat Nov 15 20:33:35 -0800 2008 added MTV::Genre with find(), artists(), and vi... [tiegz]
file ruby-mtv.gemspec Fri Oct 31 13:35:10 -0700 2008 release of 1.3; now with Hpricot [tiegz]
directory test/ Sat Nov 15 20:41:51 -0800 2008 updated TODOs and took out commented stuff in g... [tiegz]
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