I want to create a link to start a google image search for "happy kitten" with related images to http://s21.postimg.org/3vi73y0c6/funny_cats_wallpaper_gallery_12.jpg
Normal text search:
https://www.google.com/search?hl=en&tbm=isch&q=happy+kitten
When I use "search by image" and add the URL, a cryptic session ID is used and the sent request is:
https://www.google.com/searchbyimage?image_url=http%3A%2F%2Fs21.postimg.org%2F3vi73y0c6%2Ffunny_cats_wallpaper_gallery_12.jpg&btnG=Search+by+image&image_content=&filename=
But the error reads that the URL is not public.
How would I create such an URL?
The correct URL for Google Image search by Image is:
http://images.google.com/searchbyimage?image_url=YOUR_HOSTED_URL
Try this one out http://www.google.com/images?q=word of course instead of word you should type in your search word (or words with + in between), for your example
http://www.google.com/images?q=happy+kitten
Related
I need an alternative to Google Custom Search for a website I look after, it has to be something that will crawl a website, index it, allow fiddling of priorities, and then allow search queries via REST or something similar and return XML or JSON etc. It needs to run on a Windows Server instance.
So, I'm up and running with http://www.opensearchserver.com/ and it seems to do the trick, but can't, for the life of me, work out how to get thumbnail images in the results? I've searched the documentation and read everything I could, but can't find out how to do this (or how to get my head around it).
I'm crawling standard web pages and they all have thumbnail meta data, which I'm assuming should be able to be parsed somehow for results and included in the JSON results?
Any pointers at all would be very helpful, thanks!
I figured this out, in case anyone else is struggling, here's how I did it. The answer is in the documentations, it's just not that simple.
Read: http://www.opensearchserver.com/documentation/faq/crawling/how_to_extract_specific_information_from_web_pages.md - it contains the method
Assume you set up a 'web crawler' index.
Assuming you're using a meta thumbnail like this:
<meta name="thumbnail" content="http://my_cdn.com/news/images/29637.jpg">
Go into Schema / Fields. Add a new field called 'thumbnail' with index no, store yes, vector no, analyser Text, copy of blank. Save that.
Now go to schema / parser list, edit HTML parser. Go to 'field mapping', now add a new regex for the thumbnail in the html. We map from the 'htmlSource' to the thumbnail' with the matching regex.
My imperfect regex (that works though) is:
htmlSource -> linked in: thumbnail -> captured by:
(?s)<meta name="thumbnail" content="(.*?)">
Now SAVE this and go to crawl/manual crawl, enter a url that has a thumbnail and then check if the field now appears in the list below when it's read. If not check your regex, and check you actually saved the HTML Parser changes.
To get the thumb in your results, simply add the fieldname to the JSON you send with the query:
"returnedFields": [ "
"url",
"thumbnail"
],
If user search a particular keyword in google and google returns set of results with url. Now if user comes to my website after clicking any result, then how can I know that search keyword.
In bing and yahoo I am able to get this using "q" and "p" respectively. Like "http://www.bing.com/search?q=......" and "http://in.search.yahoo.com/search......?p=......&.....".
But in google I am unable to find any parameters to get search keyword. I am using php.
Please help.
EDIT:
It is not possible to get the search string once you click on a search result.
if I search for stackoverflow.. this is what I get.. link not showing up properly in a comment..
so adding an answer.. you should be able to "?q=" as well for google
https://www.google.com/search?q=stackoverflow&rlz=1C1CHFX_enUS524US524&oq=sta&aqs=chrome.3.69i60l3j69i59j69i57j69i65.2857j0&sourceid=chrome&ie=UTF-8
With a lot of search engines, you can find the string you are searching in the URL.
However, http://drugcompare.destinationrx.com/Home.aspx does not let me do this. When I search something, the resulting URL is http://drugcompare.destinationrx.com/DrugCompare.aspx no matter what.
Is there any way I can find out whether I can search the website by adding something to the end of the URL, like "?query=searchstring" instead of using the form provided on the page? Basically I need a unique URL.
that website you pointed at uses POST to send data for its search query which means you wont be able to see or append it on the URL bar. The reason for that is either for security or the search query it generates is a complex object or too long and does not fit in a url. websites such as search engines uses GET, with that you can append your search query in the url by following the syntax it generates.
On my search results page I would like to display the phrase that the user searched for.
For example, instead of using the title Search Results: as you can see in the screenshot, I would instead like to use the title Search Results for vitae:
Is it possible to pull in the searched word/s?
At present the title is hard coded within the web part container that surrounds the search results web part.
Screenshot of search results currently:
I have had a response back from Kentico about how to do this. See solution below.
Your Search Results: text is filled probably in the Container title
property of your smart search web part, so please just change it to
the following one:
Search Results for {?searchtext?}:
This works perfectly! {?searchtext?} pulls in the searched word.
Does anyone know if and how it is possible to search Google programmatically without entering the query in a search box? I want to double click a word in a webpage and get the google search results.
You could just link to the URL:
http://www.google.com/search?q=query+here
Pretty simple. Also, if you use .com it should automatically redirect to the user's own language-specific page, unless you specify the language in the lang= parameter.
You can create a bookmark, AKA, a bookmarklet since its actually JavaScript code in most any web browser:
javascript:window.open("https://www.google.com/search?q=" +
encodeURIComponent(window.getSelection()).substr(0,2000), "_self");
you can substitute Google for Bing or any preferred search engine, e.g.,
javascript:window.open("http://www.exalead.com/search/web/results/?q=" +
encodeURIComponent(window.getSelection()).substr(0,2000), "_self");
will open up a query at Exalead, a European competitor to Google.
Breaking it down, the JavaScript code does the following
javascript:window.open( // we will be opening a link
"https://www.google.com/search?q=" + // we will be using Google as our base search engine
encodeURIComponent( // we have to convert spaces to %20 and change rest of string to encoded URI specs
window.getSelection()).substr(0,2000), // get the selected text and grab first 2000 characters of encoded string
// since Google caps string queries at 2048 characters - you may have to shorten this slightly
"_self"); // open in same tab - use "_blank" or other desired target