Additional Parsing of AMG (Web Sources)


#1

I'm trying to create a web sources script for AMG. Unlike the original script, i only am interested in parsing the AMG track picks (those little V signs aside of the track title, usually indicating the most notable/popular tracks of an album).

But I'm no coder and couldn't get my script to work.
This is what I came up with, I tried to make it resemble amg.scr track parser as much as I could.

outputto "comment"
findline "<tr class=\"visible\""
do
   findline "<TD class=\"cell-img\"" 2
   moveline 1
   if "<img src=\"/i/pages/site/icons/check.gif\" alt=\"AMG Pick\" title=\"AMG Pick\" />"
      say "Notable"
   endif
   findline "></div>"
   moveline 1
while "<tr class=\"visible\""

It looks fine, but when you try it, it outputs Notable to ALL comment tags the number of times it is indicated, really not what I was aiming for.

For example this album has 3 tracks indicated, so what this script will do is output "NotableNotableNotable" to all tracks, instead of "Noteable" to each indicated track.

Please help.


#2

Note: outputto "field" can only have different content if "tracks" is used.
If another field is used, they all get the same values.
Only "tracks" supports the say "|" command.

outputto "tracks"
findline "<tr class=\"visible\""
do
  findline "<TD class=\"cell-img\"" 2
  moveline 1
  if "<img src=\"/i/pages/site/icons/check.gif\" alt=\"AMG Pick\" title=\"AMG Pick\" />"
     say "Notable"
  endif
  say "|"
  findline "></div>"
  moveline 1
while "<tr class=\"visible\""

This works, but it will overwrite your TITLE fields.


#3

Oho, it works. But then again, I'll be losing my titles everytime I use it.

Any way of overcoming this minor difficulty? I thought maybe using the Tags window (alt+t) and temporarily renaming the TITLE fields to something else, but it's stubborn, it wouldn't do it.


#4

You can make 2 different actions to do this semi-automatic.

The first copies your TITLE tags to another field. The name is arbitrary, e.g TEMP
Then you run your AMG web query.
After that, the second action that
Copies the current TITLE tags to COMMENT
Copies the real titles from TEMP to TITLE
and finally deletes TEMP

Copying is done with "Format value" and deleting, I don't have the english translation, but maybe it is called "Remove fields"


#5

Thanks and all, but Format Value doesn't seem to copy anything. It asks me for a field and a formatstring, and when I give him a field, say TITLE, and I give him a string, say TEMP, it bluntly writes TEMP in all TITLE fields.

EDIT: I'VE JUST READ THE DOCUMENTATION! Thanks a bunch, it worked!


#6

For example, to copy the Title tags to TEMP, you enter this:
Field:
TEMP
Formatstring:
%title%

edit: ok, nice to hear.