use strict; use Winamp::Control; use WWW::Mechanize; use warnings; my $agent = Winamp::Control -> new (host => '127.0.0.1', port => '4800 +', passwd => 'pass'); my $playing = $agent->getcurrenttitle(); my $artistsong = $agent->getcurrenttitle(); $artistsong =~ s/\d.*?\s//s; my $firstletter = $artistsong; $firstletter = substr($artistsong,0,1); my $artistname = $artistsong; $artistname =~ s/ -.*//s; $artistname =~ tr/a-z/A-Z/; my $songtitle = $artistsong; $songtitle =~ s/.*- //s; my $lyrics = WWW::Mechanize -> new (autocheck => 1); $lyrics -> get('http://www.azlyrics.com/'); $lyrics -> follow_link(text => $firstletter, n => 1); $lyrics -> follow_link(text => $artistname, n => 1); $lyrics -> follow_link(text => $songtitle, n => 1); my $content1 = $lyrics -> content(format => "text"); print "$artistname"; print "$songtitle \n"; print $content1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: winamp lyrics script
by mpeg4codec (Pilgrim) on Apr 22, 2006 at 19:08 UTC | |
|
Re: winamp lyrics script
by Anonymous Monk on Apr 25, 2006 at 17:20 UTC |