NAME
Yahoo::Music::Ratings - A method for retrieving a Yahoo! Music members song ratings.
SYNOPSIS
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();
DESCRIPTION
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 :)
METHODS
new( $hashref )
new() expects to find a hashref with a key and value of memberName
(Yahoo Music! Member Name).
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.
returns an object reference
getRatings
Depreciated, please see getSongs
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
],
getArtists
No arguments are required.
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();
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:
[
'The White Stripes', # Artist
'90' # Rating
],
getAlbums
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->getAlbums();
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:
[
'Radiohead', # Artist
'OK Computer', # Album
'90' # Rating
],
tab_output [optional]
No arguments required.
You must call either getSongs()
, getArtists()
or getAlbums()
prior to using this function.
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
error_message [optional]
If any previous function returns 0 you can call error_message()
to get a descriptive error message.
Returns a string with the error.
findMemberId [optional]
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
EXPORT
None by default.
SEE ALSO
Yahoo::Music::Ratings requires XML::Simple or LWP::UserAgent.
AUTHOR
Pierre Smolarek - smolarek a-t cpan d-o-t org
COPYRIGHT AND LICENSE
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.