jumping directly to first search result

Post Reply
Karen
Posts: 4
Joined: Wed May 30, 2001 6:56 am

jumping directly to first search result

Post by Karen »

We would like to be able to link dynamically to an online community resources directory that is updated quarterly at which time all the filenames change.

The target site has a Webinator search. Is there any way to jump directly to the first search result instead of displaying the list of results? Something like Google's I'm Feeling Lucky which takes you directly to the first site on the list?

This would allow us to use a Webinator search string (e.g. http://www.prairienet.org/cgi-bin/texis ... bmit=Go%21)
and go directly to the correct program page:
http://www.prairienet.org/helpbook/fs010036aa.html

Thanks!
Karen
Posts: 4
Joined: Wed May 30, 2001 6:56 am

jumping directly to first search result

Post by Karen »

P.S. We manage both sites.
Karen
Posts: 4
Joined: Wed May 30, 2001 6:56 am

jumping directly to first search result

Post by Karen »

Customizing the search script affects all Webinator profiles, though, right? I vaguely remember that it's possible to create a custom script for a particular profile. Do I create a copy , e.g. search-custom, modify that and then use this to execute the search?
../search-custom/?pr=profilename

Thanks!
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

jumping directly to first search result

Post by mark »

Here's something I've used before to jump to pages by title. Do this before any output is generated (like the first thing in main). If there's no exact title match it will fall through and do the normal search.

<init>
<rex '"' $query>
<if $ret eq "">
<strfmt '"%s"' $query>
<else>
<$ret=$query>
</if>
<sql max=1 "select Url from html where Title\Description\Keywords\Meta\Body likep $ret and Title=$query">
<header name=Location value=$Url>
<html><head>
<META HTTP-EQUIV="Refresh" CONTENT="0; URL=$Url">
</head>
<body>
Go <A HREF="$Url">here</A>.<P>
</body>
</html>
<exit>
</sql>
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

jumping directly to first search result

Post by mark »

Yes, creating a copy is one way to do it. Or you could put logic in the script to check the profile name and only perform the special action for the desired one. Or only if some other variable is set, eg jump=y or such.
Post Reply