Now that I can get the script to work I got a few problems. I found some code by Riamus in his weather bot to get $htmlfree info.
on *:SOCKREAD:toplist: {
if ($sockerr) {
echo -s SockError $sockname $sockerr
return
}
else {
var %temptext
sockread %temptext
if (*<div class="searchResultAlb_Col_txt_1_1_1">* iswm %temptext) || (*<div class="searchResultAlb_Col_txt_1_2">* iswm %temptext) {
write socktemp.txt $htmlfree(%temptext)
}
}
}
alias -l htmlfree {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&nbsp;)
return %x
}
It writes the album name and the artist on two seprate lines and has 4 tab spaces in front of it.
10 Bare Essentials
Artist: Bobby Bare
Thats how it writes to the txt file. What I cant figure out is how to get rid of the 4 tab spaces and put the album and artist on the same line. I tried a few different things but all with no success. The *<div class="searchResultAlb_Col_txt_1_1_1">* is the album line and *<div class="searchResultAlb_Col_txt_1_2">* is the artist line. Thanks