NAME

 
  allMusicGuideSearch.pl - search AllMusicGuide's website for artist information

SYNOPSIS

 
 Run the program like this:
        >perl allMusicGuideSearch.pl Kraftwerk
   
   returns:
   
        Name: Kraftwerk; Genre: Electronica
 
 Use -a flag (for albums) to get main discography:
        >perl allMusicGuideSearch.pl -a Kraftwerk
        
   returns:
        
        Name: Kraftwerk; Genre: Electronica
        Albums: Kraftwerk 1
        Kraftwerk 2
        Ralf and Florian
        Autobahn
        Radio-Activity
        Trans-Europe Express
        The Man-Machine
        Computer World
        Techno Pop [Not Released]
        Electric Cafe
        Tour de France Soundtracks
        Minimum-Maximum [live]
        Ruckzuck! (Live 1971)
                
 Use quotes for names with multiple words:
        >perl allMusicGuideSearch.pl "The Cars"
   
 Optionally, enter album name as second search term:
        >perl allMusicGuideSearch.pl "The Cars" "Candy O"
   
 Or use a text file as argument and program will read in a list of arguments:
        >perl allMusicGuideSearch.pl artistList.txt
   
 Adding a second text file and program will write output to file:
        >perl allMusicGuideSearch.pl artistList.txt searchResults.txt
   
 Or leave out the arguments:
        >perl allMusicGuideSearch.pl
   and the program will prompt you for search terms.

DESCRIPTION

Program to search AllMusicGuide's website for artist name, genre, and albums (optional).


VERSION HISTORY

 
 * 0.1  2/5/06  Program created. Can perform simple search. Enter artist name and program will 
                search for it on the amg website. If amg finds a match and returns an artist 
                page, program will parse out artist name and genre from the results.
                
                Known bugs: 
                    Says "<input> outside <form> at C:/Perl/site/lib/WWW/Mechanize.pm line 1723"
                        twice when program runs. Doesn't affect performance.
                                
 
 
 * 0.2  2/11/06 Much progress. Program now separated into subroutines. Added subroutine to look
                through search results to find a possible match. Basically, amg displays more 
                likely result in bold on the search results page, so the program just checks to
                see if there is one (and only one) bold link which matches the search terms
                exactly. If so, it follows the link. Also added subroutine to extract list of
                albums from discography page.
                                
                Known bugs: 
                    Still says "<input> outside <form>..."
                    Sometimes gives error message for names that contain a comma (Dylan, Bob).
                        (But still functions correctly)
                                
 
 * 0.3  2/14/06 Added the ability to read in artist names from a text file. Added subroutine,
                getSearchTerms() to deal with the many ways to get search criteria. Cleaned up
                code a lot. Found a way to turn off warnings for those parts of the code that
                caused "<input> outside <form>..." message.
                                
                Known bugs: 
                    Still gives error message for names with commas.
                        (But still functions correctly)
                                        
* 0.4   2/15/06 I feel like I re-did everything, but program functions pretty much the same.
                Changed getSearchTerms() so that it will read a text file w/ artistID and
                artistName fields (and optionally genre and album fields) and will return a
                hash instead of an array. Changed the search results subroutines so that they
                create a hash instead of an array and return ($artist, $genre) instead of
                just a link to the artist page (this meant pretty much re-writing them
                comletely). Added a filter subroutine to remove unnecessary characters from
                searches. Discovered that the error message I was getting before had nothing
                to do with commas in names, but that those names were returning amg pages for
                classical artists, which this program doesn't yet recognize.
                                
                Known bugs: 
                    Seems that the $DOWARN stuff doesn't work. It turns warnings off, but
                        doesn't turn them back on.
                    Doesn't understand certain characters from amg (turns "é" into theta)
                                                                                
* 0.5   2/16/06 Now I've got it set up so that it will search by album title. This only works
                with text file input, not with standard user input. It just depends
                on how many columns there are in the text file -- if there are four columns,
                it assumes that the fourth column is the album name and it will then search
                by album name, otherwise it will search the normal way. Also, I changed the 
                regular expressions that extract information from the web pages to try and 
                make them slightly easier to update if and when amg changes there site.
                Basically, I just created a long list of variables that I put at the beginning
                of the program.
                                
                Known bugs: 
                    Same as last time.
                                                                                
* 0.6   2/22/06 Added a couple of command line flags: one to turn on the debugger and one to 
                control whether the program retrieves albums. Also, made it so that you can
                pass two arguments from the command line and the first will be taken as
                artist name and the second will be album. Also fixed a number of bugs that
                popped up after the last update.
                                
                Known bugs: 
                    Same as last time.
                                                                                
 
* 0.7   2/28/06 Fixed the problem with unusual characters. Now it translates the artist name
                to utf8. Also, got rid of that DOWARN stuff, it didn't work anyway. Now I
                just use it with warnings off.
                               
                Known bugs: 
                    Warnings.
                                                                            
                To Do:
                    Search by artist if album search fails. Or maybe the other way around?
                    Perhaps set it up so that, if it returns multiple matches, it will record
                        the best match, but make a note that there were other possible matches.

SEE ALSO

The site that we search: http://www.allmusic.com

WWW::Mechanize man page: http://www.perl.com/pub/a/2003/01/22/mechanize.html


AUTHOR

Jacob Turino

2006