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

Is there a way to send a search to google when 0 result ?

Quote Reply
Is there a way to send a search to google when 0 result ?
Hello,
is there a trick to automatically send a search in another search engine when my own linksql returns 0 result ?

I hate when someone search and is returned with 0 result.

Thanks in advance,
Brakkar
Quote Reply
Re: [brakkar] Is there a way to send a search to google when 0 result ? In reply to
In fact I'm going to try the cafefind and the other gossamer plugins.
Does anyone know if it takes long for them to approve ones submission ?

Cordially,
Brakkar
Quote Reply
Re: [brakkar] Is there a way to send a search to google when 0 result ? In reply to
How about my SearchFeed_Results plugin? Does pretty much the same thing, and you earn commission on each click :)

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] Is there a way to send a search to google when 0 result ? In reply to
I suscribd and I will test it.
Do you know a way, to have a 0 search result redirect to a custom URL (when I can put <%term%>) instead of loading the advanced search page ?

Thanks in advance,
Brakkar
Quote Reply
Re: [brakkar] Is there a way to send a search to google when 0 result ? In reply to
You could try putting something like this in search.html;

<%if query%>No results were found to match "<%query%>". You can <a href="your url goes here and you can use <%query%> in it to pass the query along">click here for external results<%endif%>

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] Is there a way to send a search to google when 0 result ? In reply to
Thanks for your answer.
But I would prefer it to AUTO-redirect to an external page, instead of providing just a link. So if there are 0 result, user would automatically be sent to a querried google page.

I was thinking about doing it with a meta redirect tag to a specific url that would be loaded ONLY if there are no result.
But I don't know how to do this.

THanks in advance,
Brakkar
Quote Reply
Re: [brakkar] Is there a way to send a search to google when 0 result ? In reply to
Something like this:

<%if query%><META HTTP-EQUIV="refresh" CONTENT="0;URL=http://www.google.com/search?q=<%term%>"><%endif%>

If <%term%> doesn't work try <%query%>.
Quote Reply
Re: [afinlr] Is there a way to send a search to google when 0 result ? In reply to
Thanks,
but wouldn't this systematically load google even if I have result in my links database ?

Cordially,
Brakkar
Quote Reply
Re: [brakkar] Is there a way to send a search to google when 0 result ? In reply to
No - you put it in search.html - this template is only shown when there are no results or the advanced search page is requested (in which case there should be no <%query%> tag and the <%if query%> code will not be run).
Quote Reply
Re: [afinlr] Is there a way to send a search to google when 0 result ? In reply to
Thanks,
works really wel ;).

Brakkar
Quote Reply
Re: [brakkar] Is there a way to send a search to google when 0 result ? In reply to
Yeah, you would probably need a modification to my SearchFeed_Results plugin. Basically, don't make it grab results from SearchFeed, but instead simply redirect to a predefined URL, passing the query along with it.

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] Is there a way to send a search to google when 0 result ? In reply to
Can you give more details on how to do it please andy, or how I could redirect directly when there is no result, without redirect tag, with a link that can support <%term%> ?

Thanks in advance,
Brakkar
Quote Reply
Re: [brakkar] Is there a way to send a search to google when 0 result ? In reply to
For what it's worth, here are some code snippets to provide links to various search engines:

Google
<a target="_blank" href="http://www.google.com/search?num=10&query=<%term%>&ie=utf8">Google</a>

Google Australia - change AU to your Google country code
<a target="_blank" href="http://www.google.com.au/search?num=10&query=<%term%>&meta=cr=countryAU&ie=utf8">Google Australia</a>

Yahoo
<a target="_blank" href="http://search.yahoo.com/bin/search?p=<%term%>">Yahoo</a>

AllTheWeb
<a target="_blank" href="http://www.alltheweb.com/search?query=<%term%>">AllTheWeb</a>

I have these as a template that is included in the footer of search results pages. Hope it helps someone Smile.
Quote Reply
Re: [aus_dave] Is there a way to send a search to google when 0 result ? In reply to
Cool...

Shouldn't it be <%query%> though, and not <%term%>? Wink

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] Is there a way to send a search to google when 0 result ? In reply to
Andy, I thought there was a reason I went with <%term%> instead of <%query%> in the first place, but after a quick test I see that <%query%> works equally well.
Quote Reply
Re: [aus_dave] Is there a way to send a search to google when 0 result ? In reply to
I didn't even know <%term%> was a tag Crazy

The search form has a field name of 'query', thus I have always just assumed its <%query%>

:)

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] Is there a way to send a search to google when 0 result ? In reply to
I think that <%term%> is just a url-friendly version of <%query%>.
Quote Reply
Re: [afinlr] Is there a way to send a search to google when 0 result ? In reply to
Aaaah... always good to know :)

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!