Jonathan Gardner wrote:

> So basically, I would modify the template so it showed only the link, and maybe
> the text. Then, in my serach results cgi script, I would call htsearch, get the
> results, and parse out the link, and then process the link in the script.
> 
> Sounds like this could work.

Yeah, using my wrapper as an example, you could modify cgi_long.html:

$(TITLE)||$(EXCERPT)||$(URL)


Then slurp it into an array (@content):

&GetResults($URL);

sub GetResults{
        $url = shift;
        unless(defined(@content = get $url)) {
                die "Could not get $url\n);
        }
        #then you could roll through each record and check for the 
        #"distinguishing marks" and return the appropriate image/extra text
        if(@content[0] =~ m|NOMATCH|) {
                print qq(Error message blah blah blah);
        } 
        else {
                foreach $i(@content) {
                        ($title,$excerpt,$url) = split(/\|\|/,$i);
                        #do some regexs to get the info you need
                        #to decide what image to show
                        $i =~ m|foo.com/(.*?).html$|;
                        
                        $image = "$1\.gif";

                        #Format the output of each listing
                        print qq(<A HERF="foo.com/baz.html"><IMG SRC ... etc etc\n);
                        
                }
        }
        
        
}


Untested - off the cuff, but the theory looks right.   

Let me know how you progress.

-- 
Clint Gilders
Servermaster Onlinehobbyist Inc.
[EMAIL PROTECTED]

_______________________________________________
htdig-general mailing list <[EMAIL PROTECTED]>
To unsubscribe, send a message to <[EMAIL PROTECTED]> with a 
subject of unsubscribe
FAQ: http://htdig.sourceforge.net/FAQ.html

Reply via email to