Yahoo::Music::Ratings - A method for retrieving a Yahoo! Music members song ratings.
use Yahoo::Music::Ratings; my $ratings = new Yahoo::Music::Ratings( { memberName => 'yahooMusicMemberName', } ); # Fetch an arrayRef of all yahooMusicMemberName song ratings # this may take a couple minutes... my $arrayRef = $ratings->getRatings(); # Print out a nice tab seperated version so that we can easily # read the list in a spreadsheet program (and then filter by # artists etc). tab_output() will output in artists alphabetical # order. print $ratings->tab_output();
This module provides a way to retrieve a user's list of song ratings from Yahoo!'s Music service, including the LaunchCast and Unliminted services.
As Yahoo! do not provide an offical feed for a member to download their ratings, the methods used within this module are subject to change and simply may not work tomorrow. However at the time of writing this README i would suspect the methods used should be stable for atleast a few days :)
new() expects to find a hashref with a key and value of memberName (Yahoo Music! Member Name).
memberName
my $ratings = new Yahoo::Music::Ratings( { memberName => 'smolarek', progress => 0 } );
Providing a true value to the optional progress argument will give you a simple progress report printed to STDOUT.
progress
returns an object reference
Depreciated, please see getSongs
No arguments are required.
Fetches a members song listing. This function will need to make several calls to the Yahoo! Music site and therefore may take upto a few minutes on a slow connection.
my $arrayRef = $ratings->getSongs();
getRatings() will retun 0 if a problem was encountered or an arreyRef if everything worked as planned. The arrayRef contains a 3d array of ratings.
Example output:
[ 'Red Hot Chili Peppers', # Artist 'Under The Bridge', # Song 'Blood Sugar Sex Magik', # Album '100' # Member Song Rating ],
Fetches a members artist ratings. This function will need to make several calls to the Yahoo! Music site and therefore may take upto a few minutes on a slow connection.
my $arrayRef = $ratings->getArtists();
[ 'The White Stripes', # Artist '90' # Rating ],
my $arrayRef = $ratings->getAlbums();
[ 'Radiohead', # Artist 'OK Computer', # Album '90' # Rating ],
No arguments required.
You must call either getSongs(), getArtists() or getAlbums() prior to using this function.
getSongs()
getArtists()
getAlbums()
Will return a large string containing a tab seperated value of ratings requested previously in artist alphabetical order. Simply pipe this string to a file and open in a spreadsheet application for easy filtering and readability. If an error has been detected, will return 0.
Example
The Police Every Breath You Take Synchronicity 90 Van Morrison Brown Eyed Girl Blowin' Your Mind! 90
If any previous function returns 0 you can call error_message() to get a descriptive error message.
error_message()
Returns a string with the error.
To get a member's player ratings we need to convert the memberName into a memberId (bigint). This ID servers little other purpose, however should you wish to retain this ID or to seak for several different member ID's without further need to query the ratings then simply exectute this function without arguments.
returns an int
None by default.
Yahoo::Music::Ratings requires XML::Simple or LWP::UserAgent.
Pierre Smolarek - smolarek a-t cpan d-o-t org
Copyright (C) 2006 by Pierre Smolarek
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install Yahoo::Music::Ratings, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Yahoo::Music::Ratings
CPAN shell
perl -MCPAN -e shell install Yahoo::Music::Ratings
For more information on module installation, please visit the detailed CPAN module installation guide.