Google Answers Logo
View Question
 
Q: searching list of only certain sites ( No Answer,   2 Comments )
Question  
Subject: searching list of only certain sites
Category: Computers
Asked by: andy4598-ga
List Price: $2.00
Posted: 29 Oct 2002 16:09 PST
Expires: 01 Nov 2002 01:09 PST
Question ID: 92560
Is there a way to use Google (or another good search engine for that
matter) to search only a select list of sites.   I already know that
you can search a single site using a domain restriction on Google -
for instance if I only wanted to search cnn.com.   However,  I would
like to use
Google or another engine to search a list of only about 40 sites.  Is
there any way to search these 40 sites at once, excluding all other
sites?

Request for Question Clarification by brightshadow-ga on 30 Oct 2002 09:44 PST
Do you need to know how to configure and automate this, or do you just
need to know the syntax required for a search string to use once
you've set up the search engine?

If, for example, you want to search for the word "pancake" on
www.yahoo.com, www.microsoft.com, and www.cooking.com, but NOT on any
other sites, the search string would be:

"pancake" site:www.microsoft.com OR site:www.yahoo.com OR
site:www.cooking.com

[://www.google.com/help/refinesearch.html]

If you wanted to restrict searches to a particular list of sites, you
could just have the front-end page append the list of "approved" sites
to the end of what the user typed when submitting to the search
engine.

Is that sufficient for an answer, or were you looking for something
more specific?

Clarification of Question by andy4598-ga on 30 Oct 2002 10:18 PST
brightshadow,

thank you. your response is very helpful and I am satisfied with it as an answer.

However, could you clarify what you mean by "you
could just have the front-end page append the list of "approved" sites
to the end of what the user typed when submitting to the search
engine."?  How would one do this?

thank you
Answer  
There is no answer at this time.

Comments  
Subject: Re: searching list of only certain sites
From: josh_pixelfresh-ga on 31 Oct 2002 12:30 PST
 
No answer button for me so I guess I'll post it here... I've wanted to
post something for the fun of it but I can't answer much! Anyway,
paste the following into an html file and it should search Google in
the context of 5 sites (which you can edit). Alternatively see it live
here:

http://www.pixelfresh.co.uk/searchengines/google5sites.html

===========================================================

<HTML>
<HEAD>
<TITLE> Search selected sites on Google </TITLE>
<script language="JavaScript">
	
	function makeQuery() {
		var numSites = 5; // change this if you add more site fields
		var extraBit = '';
		var fullUrl = '';
		for (var i=1; i<numSites; i++) {
			if (eval('document.form1.site' + i + '.value').length) 
			{
				if (extraBit.length) {
					extraBit += ' OR';
				}
				extraBit += ' site:' + eval('document.form1.site' + i + '.value');
			}
		}
		fullUrl = '://www.google.com/search?q=' + escape('"' +
document.form1.q.value + '"' + ' ' + extraBit);
		location.href = fullUrl;
	}

</script>
</HEAD>
<BODY>
	<form name="form1" onsubmit="makeQuery(); return false;">
		<b>Sites</b><br>
		Site 1: <input type="text" name="site1"
value="www.yahoo.com"></input><br>
		Site 2: <input type="text" name="site2"
value="www.microsoft.com"></input><br>
		Site 3: <input type="text" name="site3"
value="www.amazon.com"></input><br>
		Site 4: <input type="text" name="site4"
value="www.lastminute.com"></input><br>
		Site 5: <input type="text" name="site5"
value="www.pixelfresh.co.uk"></input><br>
		<br>
		<b>Query</b><br>
		<input type="text" name="q"></input>
		<input type="submit" value="Search"></input>
	</form>
</BODY>
</HTML>
Subject: Re: searching list of only certain sites
From: andy4598-ga on 01 Nov 2002 01:09 PST
 
josh_pixelfresh-ga,

This is fantastic, and is exactly what I was looking for.  Thanks so much!

andy4598-ga

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy