Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Remote Search - please help

Quote Reply
Remote Search - please help
A partner site of mine would like to display my search results.

1. I have installed the XML plugin for LinksSQL and tried to call search.cgi with a hidden tag:

<input type="hidden" name="xml_feed" value="1">

More than 50% of all queries return the following error:

Code:
Whitespace is not allowed at this location. Error processing resource.


Other users have reported this error, but obviously no solution has been found yet. Also, a high percentage of valid queries just returns the search template without search results (I have not altered the xml template).

2. Another solution is to use the remote_search.cgi script Alex has posted in this thread:

http://www.gossamer-threads.com/...orum.cgi?post=199494

Running the script I receive the following error message:

Code:
Missing right curly or square bracket at www/cgi-bin/remote_search.cgi line 84, at end of line
syntax error at www/cgi-bin/remote_search.cgi line 84, at EOF www/cgi-bin/remote_search.cgi had compilation errors.


Ok, after adding the curly bracket I get the msg:

Code:
Bareword "r" not allowed while "strict subs" in use at www/cgi-bin/remote_search.cgi line 84.


Does anyone have a working version of the script?

3. How to deal with queries that do not return any matching records?

Any help is highly appreciated!

Last edited by:

Thomas.: Mar 2, 2003, 3:25 AM
Quote Reply
Re: [Thomas.] Remote Search - please help In reply to
Not sure about the other ones...but regarding the 'bareword' thing....have a look at line 84 Wink

Code:
sub parse_template {
#-------------------------------------------------------------------------
# Simply parse the template and replace the link loop
#
my ($TEMPLATE,$loop) = @_;
(ref $loop eq 'ARRAY') || return;
my ($loop_content) = $TEMPLATE =~ /<%link_loop%>(.*?)<%end_loop%>/sm;
my $result;
foreach (@$loop) {
my $tmp = $loop_content;
$tmp =~ s/<%\s*(.*?)\s*%>/(exists $_->{$1})?$_->{$1}:'';/seg;
$result .= $tmp;
}
$TEMPLATE =~ s/(<%link_loop%>.*?<%end_loop%>)/$result/sm;
r

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Remote Search - please help In reply to
Thanks Andy, yesterday I finally managed to get the script running, lol.
Quote Reply
Re: [Thomas.] Remote Search - please help In reply to
Glad you got it working :)

Its a bit of a pain..cos the original thread is locked for people to post anything about the bug Unsure

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Remote Search - please help In reply to
The script should definitely be corrected (for perl-challenged people like myself) and posted to the Resource Section.
Quote Reply
Re: [Thomas.] Remote Search - please help In reply to
Maybe Alex/GT will see this thread, and correct it Smile I didn't see any posts about the bug prior to yours...so maybe they just don't know :p

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Thomas.] Remote Search - please help In reply to
In Reply To:
Thanks Andy, yesterday I finally managed to get the script running, lol.


Can you share how you got it running? I'm getting an internal server error.

CCUnet
my Christian web
Quote Reply
Re: [ccunet] Remote Search - please help In reply to
Obviously the script got truncated while uploading.

Just replace the last line with
Code:
return $result;
}
Quote Reply
Re: [Thomas.] Remote Search - please help In reply to
Thanks Thomas,

I'm still getting the 500 error can you call it from the browser or does it need to be called from a form?

CCUnet
my Christian web
Quote Reply
Re: [ccunet] Remote Search - please help In reply to
Have you set the permissions for the file to 755?

Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] Remote Search - please help In reply to
yes I have set to 755 and checked all the usual perl options/

CCUnet
my Christian web