Re: [htdig] Converting Keyword Spaces in Results for Linking


Shantonu Sen (ssen@mit.edu)
Fri, 30 Apr 1999 17:32:52 -0400 (EDT)


i have an idea... ;-)

the first step is to put some placeholders in either header.html or
footer.html, depending on what you want. for the sake of example, let's
call them:

<!--ALTAVISTA_TAG-->

then, have your search form point to a perl wrapperscript (let's call it
htsearch-wrap). the wrapper script would essentially pass on the GET
request to htsearch. however, the wrapper would then parse the ouput and
look
for tags like the one above. when it finds one, it would extract from the
original query string whatever it needs, and then reformat it to fit the
particular search engine, and then insert this new HTML into the output
stream.

you could probably also implement it with shell script using sed, but it
might get hairy, although there might be a speed benefit.

hope this abstract answer helps,
shantonu sen

On Fri, 30 Apr 1999, NetCent Pub wrote:

>
> Hi Folks,
>
> I've poured through the htdig site trying to find an answer on this one to no
> avail, so hopefully someone knows how (if) it can be done.
>
> On the search results pages created by htdig, I need to replace the space
> between words in the search term for linking purposes. For example, say you run
> a search on "summer vacations". On your search results page, you can drop
> "summer vacations" anywhere you like, using $(WORDS). What I want to do (for
> sake of example) is to include direct URLs on the search results page to other
> directories that the user could search on that term with a single click.
>
> If I wanted to include a link on the results page like "Search AltaVista for
> summer vacations" I would need to use the url:
>
> http://www.altavista.com/cgi-bin/query?pg=q&kl=XX&q=summer+vacations
>
> However, if I use $(WORDS) to drop the keywords into the URL, the result would
> be
>
> http://www.altavista.com/cgi-bin/query?pg=q&kl=XX&q=summer vacations
>
> For an IE user, this wouldn't be a problem, IE would automatically convert the
> space to a %20 and the engine works with that too. But if the user is running
> Netscape, the space wouldn't be converted, and the results would be skewed.
>
> Any idea on how to accomplish this?
>
> Doug Archell
>
>
>
> ------------------------------------
> To unsubscribe from the htdig mailing list, send a message to
> htdig@htdig.org containing the single word "unsubscribe" in
> the SUBJECT of the message.
>

------------------------------------
To unsubscribe from the htdig mailing list, send a message to
htdig@htdig.org containing the single word "unsubscribe" in
the SUBJECT of the message.



This archive was generated by hypermail 2.0b3 on Fri Apr 30 1999 - 14:47:36 PDT