473,761 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

google search site bookmarklet

Here is a google search site bookmarklet. This lets you search a
certain website using google. What I want is the same thing, but to
search a certain geocities site. When you use the current
bookmarklet, the search takes you to site:www.geocities.com instead of
the specific site you want to search. Can someone modify this for me,
to search specific geocities sites?

Thanks for your help and btw I'm using Mozilla Suite and Firefox.

The bookmarklet is:

javascript:(fun ction(){var
h,q;h=location. hostname;q=(win dow.getSelectio n ? window.getSelec tion()
: document.getSel ection ? document.getSel ection() :
document.select ion.createRange ().text);q=prom pt('Search \''+h+'\'
using Google:',q);if( q!=null){if(h){ q='site:'+h+'
'+q;}location=' http://www.google.com/search?q='+enco deURIComponent( q);}})();

--
Murphy's Laws of Computing: The number one cause of computer problems
is computer solutions.
Jul 2 '06 #1
4 3573
Ivo
"gwtc" schreef
Here is a google search site bookmarklet. This lets you search a certain
website using google. What I want is the same thing, but to search a
certain geocities site. When you use the current bookmarklet, the search
takes you to site:www.geocities.com instead of the specific site you want
to search. Can someone modify this for me, to search specific geocities
sites?

Thanks for your help and btw I'm using Mozilla Suite and Firefox.

The bookmarklet is:

javascript:(fun ction(){var h,q;h=location. hostname;q=(win dow.getSelectio n
? window.getSelec tion() : document.getSel ection ? document.getSel ection()
: document.select ion.createRange ().text);q=prom pt('Search \''+h+'\' using
Google:',q);if( q!=null){if(h){ q='site:'+h+'
'+q;}location=' http://www.google.com/search?q='+enco deURIComponent( q);}})();
I gather you want to add the pathname up to the first '/' slash after the
hostname. In code (mind the wrap):

h==location.hos tname + location.pathna me.substring( 0,
location.pathna me.substring(1) .indexOf( '/' )+1 )

That would give you strings like 'www.geocities. com/swaisman' or
'www.geocities. co.jp/goofy_trip'.

hth
ivo
Jul 2 '06 #2
Ivo wrote:
"gwtc" schreef
>>Here is a google search site bookmarklet. This lets you search a certain
website using google. What I want is the same thing, but to search a
certain geocities site. When you use the current bookmarklet, the search
takes you to site:www.geocities.com instead of the specific site you want
to search. Can someone modify this for me, to search specific geocities
sites?

Thanks for your help and btw I'm using Mozilla Suite and Firefox.

The bookmarklet is:

javascript:(f unction(){var h,q;h=location. hostname;q=(win dow.getSelectio n
? window.getSelec tion() : document.getSel ection ? document.getSel ection()
: document.select ion.createRange ().text);q=prom pt('Search \''+h+'\' using
Google:',q);i f(q!=null){if(h ){q='site:'+h+'
'+q;}location ='http://www.google.com/search?q='+enco deURIComponent( q);}})();


I gather you want to add the pathname up to the first '/' slash after the
hostname. In code (mind the wrap):

h==location.hos tname + location.pathna me.substring( 0,
location.pathna me.substring(1) .indexOf( '/' )+1 )

That would give you strings like 'www.geocities. com/swaisman' or
'www.geocities. co.jp/goofy_trip'.

hth
ivo

Thanks ivo, but I'm not javascripted minded. Where do I add those lines?

--
Murphy's Laws of Computing: The number one cause of computer problems
is computer solutions.
Jul 2 '06 #3
Ivo
"gwtc" schreef
Ivo wrote:
>I gather you want to add the pathname up to the first '/' slash after the
hostname. In code (mind the wrap):

h==location.ho stname + location.pathna me.substring( 0,
location.pathn ame.substring(1 ).indexOf( '/' )+1 )

That would give you strings like 'www.geocities. com/swaisman' or
'www.geocities .co.jp/goofy_trip'.
Thanks ivo, but I'm not javascripted minded. Where do I add those lines?
Find in your code the bit that sais:
h=location.host name
and add immediately after that:
+ location.pathna me.substring( 0,
location.pathna me.substring(1) .indexOf( '/' )+1 )

So you get:
javascript:(fun ction(){var h,q;h=location. hostname +
location.pathna me.substring( 0, location.pathna me.substring(1) .indexOf(
'/' )+1 );q=(window.get Selection ? window.getSelec tion() :
document.getSel ection ? document.getSel ection() :
document.select ion.createRange ().text);q=prom pt('Search \''+h+'\' using
Google:',q);if( q!=null){if(h){ q='site:'+h+'
'+q;}location=' http://www.google.com/search?q='+enco deURIComponent( q);}})();

Untested, but should work. I 'm not geocities minded.
ivo
Jul 4 '06 #4
Ivo wrote:
"gwtc" schreef
>>Ivo wrote:
>>>I gather you want to add the pathname up to the first '/' slash after the
hostname. In code (mind the wrap):

h==location. hostname + location.pathna me.substring( 0,
location.pat hname.substring (1).indexOf( '/' )+1 )

That would give you strings like 'www.geocities. com/swaisman' or
'www.geociti es.co.jp/goofy_trip'.

Thanks ivo, but I'm not javascripted minded. Where do I add those lines?


Find in your code the bit that sais:
h=location.host name
and add immediately after that:
+ location.pathna me.substring( 0,
location.pathna me.substring(1) .indexOf( '/' )+1 )

So you get:
javascript:(fun ction(){var h,q;h=location. hostname +
location.pathna me.substring( 0, location.pathna me.substring(1) .indexOf(
'/' )+1 );q=(window.get Selection ? window.getSelec tion() :
document.getSel ection ? document.getSel ection() :
document.select ion.createRange ().text);q=prom pt('Search \''+h+'\' using
Google:',q);if( q!=null){if(h){ q='site:'+h+'
'+q;}location=' http://www.google.com/search?q='+enco deURIComponent( q);}})();

Untested, but should work. I 'm not geocities minded.
ivo

bingo. Thanks ivo. It works great.

--
Murphy's Laws of Computing: A complex system that does not work is
invariably found to have evolved from a simpler system that worked
just fine.
Jul 4 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2452
by: Peter Morris [Droopy eyes software] | last post by:
Hi all I want to put a google search on my website. My options are 1) Create a new <form> outside of my aspx form. Problem: I have a HeaderControl and FooterControl on each page to give my site a uniformed look. Placing it outside of the <form> would mean it would have to come after the FooterControl which, as you can probably guess, would make everything look wrong.
3
2627
by: Lakshmi Narayanan.R | last post by:
Hi Experts, I need a great Help!!. Yes, need to do a site search for dynamic pages. Expecting Google like search results. Separate tables are there with the detail . If any one experienced or having the logic with the same, pls let me know them ASAP. List the logic flow step by step for tables hadling and seach techniques.
3
2315
by: MZ | last post by:
Hello! I have registered my web page on www.google.pl 7 days ago. Till now my web page is not being found when I type a few keywords declared in meta elements. My web page is not being found even on the last position when i.e. I type: "Marcin Zmyslowski Bydgoszcz" on google search page.
3
1764
by: a.mustaq | last post by:
Hi All, I am developing a site. The client wants this site to be Google Search Optimized. How this can be achieved? Please help me. Thanks and Regards Mustaq Ahmed.A
1
3232
by: paintedjazz | last post by:
If I use Google Search as a search engine to search my website but I also use .htaccess to prevent access to the website from any host outside of my subnet, how can I determine what google sites must be enabled in .htaccess for the whole scheme to succeed?
0
2463
by: passion | last post by:
"Specialized Search Engines" along with Google Search Capability (2 in 1): http://specialized-search-engines.blogspot.com/ Billions of websites are available on the web and plenty of extremely good search engines are there like Google, Yahoo and Live to name few of them. Though this search engines have extremely efficient, complex and beautiful algorithms designed by gems of the industry, but still they may not deliver best results for...
5
2597
by: yogarajan | last post by:
hi i have create one site. i have add my site to google search result. it is free of cost or payment. pls explan how do add my site to google search am creating lot of keyword to my web page pls anyone help me Thanks Yogarajan.G
2
1635
by: anbzhagan | last post by:
Now we are making project ,in this project we want to apply google search to my site any can help or related links thanks and Regards anbu
5
10888
by: impin | last post by:
my site is listed in google search list. when i search in google like this " site:outsourceprojectstoindia.com " i should get result like this. Outsource Projects to India <About Outsource description> but i get
0
9554
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9377
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10136
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8814
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7358
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6640
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5266
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3913
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.