{"id":17381,"key":"Search_bookmarklets","title":"Search bookmarklets","latest":{"id":1209461,"timestamp":"2025-11-28T02:24:34Z"},"content_model":"wikitext","license":{"url":"https://www.appropedia.org/Appropedia:Copyrights","title":"CC-BY-SA-4.0"},"source":"''This began as a [http://web.archive.org/web/20170507094205/http://blogs.appropedia.org/2009/03/04/search-appropedia-with-one-click-handy-bookmarklets/ post on the Appropedia Foundation blog].''\n\nHighlight text on a web page, click a button on your bookmarks toolbar, and perform a search for that term on Appropedia. Sound handy? Here's how you make the button (I'm using Firefox, but I think it will work similarly on other browsers):\n\n# Copy the following code to your clipboard (i.e. highlight and press Ctrl-C):\n# :<tt><nowiki>javascript:(function(){q=document.getSelection();%20if(!q){void(q=prompt('Appropedia%20keywords:',''))};%20if(q)location.href='https://www.appropedia.org/Special:Search?search='+escape(q)})()</nowiki></tt>\n# Right click on an empty space on your bookmark toolbar. ''(If there is no empty space, rightclick the \"&gt;&gt;\" symbol at the right end of the toolbar.)''\n# Choose \"New <span style=\"text-decoration: underline;\">B</span>ookmark\" and enter a name such as \"Appropedia\". (I use \"Ap\" so it uses less space.)\n# Paste the code from clipboard (Ctrl-V) into the \"Location\" field.\n# Click the \"Add\" button. This will create the button - if you wish, you can drag and drop to a different place on the toolbar.\n\n== How do we link these? ==\n\nI'd rather just give a links to drag and drop, but creating javascript links in Wordpress or in MediaWiki is beyond me. If you know how, please help us out, so we could add this to the front page of the wiki, and put them in blog posts.\n\nYou can do the same thing with other wikis, e.g. this is the code for the [http://fr.ekopedia.org/ French language Ekopedia]:\n\n:<tt><nowiki>javascript:(function(){q=document.getSelection();%20if(!q){void(q=prompt('Ekopedia%20keywords:',''))};%20if(q)location.href='http://fr.ekopedia.org/Special:Search?search='+escape(q)})()</nowiki></tt>\n\nAnd this is for Wikipedia:\n\n:<tt><nowiki>javascript:(function(){q=document.getSelection();%20if(!q){void(q=prompt('Wikipedia%20keywords:',''))};%20if(q)location.href='http://en.wikipedia.org/w/wiki.phtml?search='+escape(q)})()</nowiki></tt>\n\n== Making your own bookmarklet ==\n\nOr do you want another wiki or website? Easy - the following method has worked for any MediaWiki site I've tried. (It should work for most other sites as well, though you may have to adjust it a little.) Let's take [Greenlivingpedia:|Greenlivingpedia] as an example. Just go to the site and search for something that you isn't a page title in the wiki, such as ''qwerty''. Then look at the url:\n\n:<tt><nowiki>http://www.greenlivingpedia.org/Special:Search?search=qwerty&amp;go=Go</nowiki></tt>\n\nJust delete the search term (''qwerty''), and anything after it, giving you:\n\n:<tt><nowiki>http://www.greenlivingpedia.org/Special:Search?search=</nowiki></tt>\n\nNow, in the original code for Appropedia, at the beginning of the post, replace the appropedia.org search url in the code (\"https://www.appropedia.org/Special:Search?search=\") which is inside single quote marks, with the new site's search url. Leave the single quote marks there, so you replace 'https://www.appropedia.org/Special:Search?search=' with 'http://www.greenlivingpedia.org/Special:Search?search=' - then just replace the \"prompt\" term in the code with something appropriate (e.g. just change Appropedia to Greenlivingpedia, so <tt><nowiki>'Appropedia%20keywords:'</nowiki></tt> becomes <tt><nowiki>'Greenlivingpedia%20keywords:'</nowiki></tt> ).\n\nSo, putting the changes in italics, you now have:\n\n:<tt><nowiki>javascript:(function(){q=document.getSelection();%20if(!q){void(q=prompt('</nowiki>''<nowiki>Greenlivingpedia</nowiki>''<nowiki>%20keywords:',''))};%20if(q)location.href='</nowiki>''<nowiki>http://www.greenlivingpedia.org/Special:Search?search=</nowiki>''<nowiki>'+escape(q)})()</nowiki></tt>\n\n''Hat tip: [http://lifehacker.com/129141/geek-to-live-ten-must+have-bookmarklets Geek to Live: Ten Must-Have Bookmarklets]'', by Gina Trapani, Oct 5 2005. This gave the code for the Wikipedia lookup bookmarklet.\n\n== Sites without a suitable search function ==\n\n:'''NOTE: These instructions are not working, and I'm not sure why. Nothing happens when clicking the bookmarklet, regardless of whether there is a \"+\" on the end of the search url in the code. '''' --[[User:Chriswaterguy|Chriswaterguy]] 21:53, 4 March 2009 (UTC)\n\nYou can also use a search engine - either because you can't get the site search to work, or you prefer it for whatever reason. Just replace the search url with this.\n\n:<tt><nowiki>http://www.google.com/search?q=site%3A</nowiki>''siteurl''</tt>\n\n...where siteurl is the address of the website you want to search. Remember that if you don't add a prefix (e.g. appropedia.org) then it will include all subdomains. If you use a prefix (e.g. www.appropedia.org) then it won't search other subdomains (e.g. blogs.appropedia.org).\n\nSo, for aidg.org, for example, the search url would be:\n\n:<tt><nowiki>http://www.google.com/search?q=site%3Aaidg.org+</nowiki></tt>\n\nand the bookmarklet would look something like:\n\n:<tt><nowiki>javascript:(function(){q=document.getSelection();%20if(!q){void(q=prompt('</nowiki>''<nowiki>Greenlivingpedia</nowiki>''<nowiki>%20keywords:',''))};%20if(q)location.href='</nowiki>''<nowiki>http://www.google.com/search?q=site%3Aaidg.org</nowiki>''<nowiki>'+escape(q)})()</nowiki></tt>\n\n{{Page data\n| license = CC-BY-SA-3.0\n| keywords = Internet searches, Websites\n}}\n\n[[Category:Websites]]"}