On Tue, 31 Aug 1999, Vadim Strizhevsky wrote:

<!--newsclipper
<input name=yahootopstories source=sports>
<filter name=map filter=hash2string
  format='%{url}: %{headline}'>
<filter name=limit number=10>
<output name=array numcols=1>
-->

Hi Charles,
  These commands depend on the "type" of the information resulting from the
previous stage. The yahootopstories handler outputs an "array of hashes
containing 'url', 'headline', and 'blurb'" (See the documentation embedded in
the yahootopstories.pm file, or shown at
http://handlers.newsclipper.com/cgi-bin/printinfo?tag=yahootopstories)

So basically yahootopstories yields a list of data items, each of which has a
url, headline, and blurb. What the "map" filter does is apply another filter
to each item in the list. In your example above, it applies the "hash2string"
filter, transforming the "url, headline, blurb" hash into a normal text
string. The output data, then is an "array of strings".

Your next filter limits the array of strings to 10, and then the last output
command prints that array out. Get it? Note that some acquisition handlers
output an array of strings to begin with, which means that you don't have to
do the map/hash2string step. See
http://handlers.newsclipper.com/cgi-bin/printinfo?tag=yahoostatenews
for example.

>       This replacement worked perfectly, and for what it's worth, can the Yahoo
>       Sports filter included in the Readme file be changed to reflect this better
>       version?

You can do the same stuff with any data you collect with yahootopstories, so
sports is fine:
  <input name=yahootopstories source=sports>

Feel free to mix and match filters with any of the news sources. You'll have
to be careful with the types, but News Clipper will yell at you if you try to
do something wrong. For a list of all filters, visit
  http://www.newsclipper.com/handlers.htm
and click on "News Clipper plugins". For example, try
  <filter name=map filter=caps>
after your hash2string command.

Hope that helps,
David

_________________________________________________________________________
David Coppit
[EMAIL PROTECTED]
President, Spinnaker Software


-
If you would like to unsubscribe from this mailing list send an email to 
[EMAIL PROTECTED] with the body "unsubscribe newsclipperlist 
YOUR_EMAIL_ADDRESS" (without the quotes) or use the form provided at 
http://www.NewsClipper.com/TechSup.htm#MailingList.

Reply via email to