I made a lyric finder app and I want to remove the
tag that azlyrics puts after every line. For example:
set songname to "Somebody Someone"
set artistname to "Korn"
set songname to every text item of songname
set artistname to every text item of artistname
repeat with x from 1 to count songname
if item x of songname contains " " then
set item x of songname to ""
end if
if item x of songname contains "'" then
set item x of songname to ""
end if
if item x of songname contains "/" then
set item x of songname to ""
end if
if item x of songname contains "." then
set item x of songname to ""
end if
if item x of songname contains "(" then
set item x of songname to ""
end if
if item x of songname contains ")" then
set item x of songname to ""
end if
if item x of songname is "&" then
set item x of songname to ""
end if
if item x of songname is "-" then
set item x of songname to ""
end if
end repeat
repeat with x from 1 to count artistname
if item x of artistname contains "'" then
set item x of artistname to ""
end if
if item x of artistname contains " " then
set item x of artistname to ""
end if
if item x of artistname contains "/" then
set item x of artistname to ""
end if
if item x of artistname is "." then
set item x of artistname to ""
end if
if item x of artistname is "(" then
set item x of artistname to ""
end if
if item x of artistname is ")" then
set item x of artistname to ""
end if
if item x of artistname is "&" then
set item x of artistname to ""
end if
if item x of artistname is "-" then
set item x of artistname to ""
end if
end repeat
set artistname to artistname as string
set songname to songname as string
set new_string to ""
repeat with i in characters of artistname
set ascii_num to the ASCII number of i
if ascii_num is greater than 64 and ascii_num is less than 91 then
set new_string to new_string & (ASCII character (ascii_num + 32))
else
set new_string to new_string & i
end if
end repeat
set artistname to new_string
set new_string to ""
repeat with i in characters of songname
set ascii_num to the ASCII number of i
if ascii_num is greater than 64 and ascii_num is less than 91 then
set new_string to new_string & (ASCII character (ascii_num + 32))
else
set new_string to new_string & i
end if
end repeat
set songname to new_string
--curl page, set search url
set azurl to "azlyrics.com/lyrics/" & artistname & "/" & songname & ".html"
set curled to every paragraph of (do shell script "curl " & azurl)
set searchurl1 to "http://search.azlyrics.com/cgi-bin/azseek.cgi?q=" & songname
set searchurl2 to "http://search.azlyrics.com/cgi-bin/azseek.cgi?q=" & artistname
--end curl page, set search url
--find lyrics
if item 3 of curled contains "robots" then
return "Sorry that song wasn't found. Try searching for the song:" & return & return & searchurl1 & return & searchurl2
else
repeat until item 1 of curled contains "<font size=2>"
set curled to rest of curled
end repeat
set curled to rest of rest of curled
set curled to reverse of curled
repeat until item 1 of curled contains "<a href=\"http://www.azlyrics.com\">www.azlyrics.com</a>"
set curled to rest of curled
end repeat
set curled to reverse of rest of rest of curled
--end find lyrics
--process lyrics
set x to 0
repeat with a from 1 to (count curled)
set x to x + 1
set item x of curled to {item x of curled & return}
end repeat
--end process lyrics
--return lyrics
set lyrics to curled as string
return lyrics
--end return lyrics
end if
Here’s a link to the app: http://returnlyrics.netfirms.com
Model: Powerbook G4 Aluminum
AppleScript: ?
Browser: Safari 312
Operating System: Mac OS X (10.3.9)