retrieving specific META tags from database

Post Reply
User avatar
Thunderstone
Site Admin
Posts: 2504
Joined: Wed Jun 07, 2000 6:20 pm

retrieving specific META tags from database

Post by Thunderstone »



I have indexed our site with gw -meta=keywords,description ...

Is there a way to select just the description from the database
(without removing the keywords)?

I would like to use the description as summary info for each hit.
However, what I currently see is that the select returns
<keywords>
<description>

That is they start on separate lines, but there does not seem
to be any significance regarding order. Also, if the content was
placed on multiple lines, gw respects that and places the information
on multiple lines.

Thanks in advance,
Tim Rosine


User avatar
Thunderstone
Site Admin
Posts: 2504
Joined: Wed Jun 07, 2000 6:20 pm

retrieving specific META tags from database

Post by Thunderstone »




Meta data, when present, will be stored in the order you specify the names.
Items will be separated by a line break. If there are line breaks in the
individual items or all of the items are not consistently there, it probaly
won't be possible to determine which item is which in the Meta field.

If keywords is always present and doesn't have any line breaks, you can
find description by looking for everything after the first line:

<rex ">>=[^\n]*\n\P=.+" $Meta>$ret


Post Reply