Scripting advice


#1

I can't work this out so I'll ask after all

Here's a section of code from Dano's discogs script

# Publisher
outputto "publisher"
findline "<tr><td align=right>Label:</td><td>"
joinuntil "</td></tr>"
killtag "*"
regexpreplace "^\s+Label:\s+" ""
regexpreplace "\s,\s{2,}" ", "
sayrest

here's the html that it would find on discogs

<tr><td align=right>Label:</td><td>

  <a href="/label/Ai+Records">Ai Records</a>

</td></tr>

I'm assuming kill "*" kills all html tags? What would that leave once they were all deleted?

I've been reading up on regular expressions, but I don't understand them fully. Can anyone let me know what those ones do with respect to the html that's shown.

I'd really appreciate any help, thanks.


#2

Look at the debug file, it shows all the effects.

killtag "*" removes all html tags, but Label: for example is not inside a html tag and therefore stays.


#3

Thanks for the response.

I've spent a good bit of time reading up on the regular expressions. It didn't really make much sense at first, but I kinda get the hang of it more now.

I'm struggling to convert something to uppercase though (fairly simple I imagine)

My code is

regexpreplace "^[A-Z]+" "$lower($1)"

It's supposed to find any uppercase letters at the begging of the line (this is for vinyl numbres on discogs), and replace with lowercase. It finds the letter ok, it just replaces the uppercase letter with

$$lower()

Can you tell me where I'm going wrong?

Thanks.


#4

Scripting functions like $lower() are not supported in the web source framework.


#5

Well at least it makes sense now :¬)

Thanks.