How to look up other people's Google Custom Searches - google-custom-search

When I attempt to use someone else's custom search by its url, I get taken instead to my own custom search admin page.
How do I use someone else's custom search url?
For example, customsearchengine.com has an entry for the OpenDOAR search.
It gives the url as: http://www.google.com/coop/cse?cx=016766439200934687091:ln-icm1qyko
When I put this in, I get redirected to https://cse.google.com/cse/all
Perhaps that custom search doesn't exist anymore. Bu the same happens when I try to look up other custom searches.

http://www.customsearchengine.com/ is super old, and not affiliated with google.
Custom Search's URL format has changed since 2008, so instead of http://www.google.com/coop/cse?cx=016766439200934687091:ln-icm1qyko
you can use
http://www.google.com/cse?cx=016766439200934687091:ln-icm1qyko
but that CSE doesn't exist any longer, so 404 error

Related

Rally : document.referrer is not returning complete URL

We have created a custom App using Rally SDK. We are providing link to this app in a custom field in USER story. Once we click on this link, it gets redirected to the App. Within this app, we want know from which User story it has redirected from.
For the same purpose we are making use of document.referrer. However, it only returns 'https://rally1.rallydev.com' and not the complete URL.
Based on our research, we come to know that meta tag for refferer with appropriate value has to be mentioned in the web page to get the complete URL. Which we think is not mentioned in this case.
Please correct if our understanding is wrong.
It will be very helpful if you could suggest any alternatives to achieve this.

Google I'm Feeling Lucky URL

So, I've spent about 2 hours trying to get the I'm Feeling Lucky URL to work. It seems the URL doesn't like the periods in the search parameter, so does anyone have any potential tricks?
Search Value= 40.840.1/8Z
The first result in a regular Google search is the correct page.
Here's what I've tried:
http://www.google.com/search?btnI=I&q=40.840.1/8Z
http://www.google.com/search?btnI=I&q=40.840.1%2F8Z
http://www.google.com/search?btnI=I&q=40%2E840%2E1/8Z
http://www.google.com/search?btnI=I&q=40%2E840%2E1%2F8Z
http://www.google.com/search?btnI=I&q=40%2F840%2F1%2F8Z
(That one was actually pretty close)
http://www.google.com/search?btnI=I&q=40%20840%201%208Z
And all of the above surrounded in quotes (%22)
The problem is that the I'm Feeling Lucky aspect doesn't work. It finds the correct results, it just doesn't navigate to the first result. I'm open to alternatives besides the I'm Feeling Lucky URL parameters as well.
I'm trying to implement this into a .NET application that provides employees with resource information, which is best received from the manufacturer's website(s). The trick is that the resources are from many different suppliers and the links need to be somewhat automatic. Basically I don't whomever manages the software to update these links. To navigate, I'm simply using the Process.Start("http://www.example.com/") command which uses the default browser to navigate to the address.
This post helped a lot by the way.
I wasn't able to get any closer than your closest one.
But if it helps, here's an alternative way of writing the "I'm feeling lucky" URL.
http://google.com/search?q=haimer+usa+40%2F840%2F1%2F8Z&btnI
What I did to find the right url is to navigate to google.com. After this I turned my internet connection off. I entered the search details and pressed submit. You can now see the url in the address bar, but it doesn't redirect you to the first result. You can now copy the url and see how google treats your dots and other weird characters.
So to recap:
Go to google.com
Turn your internet connection off
Enter search term
Press 'I'm feeling lucky'
Copy the url from the address bar
You can create a google custom search engine of your own, and either exclude certain sites or include specific sites only, use http://cse.google.com to do this.
There is a SO tag for google custom search

Make google custom search location-aware

When I search for "football images" on google.co.uk, it knows that I mean the sport that elsewhere might be called "soccer". If I do the same search on google.com, I get American Football.
I'm using the custom search API - how can I tell it that I'm in the UK and would like results relevant to here?
You can limit your engine to operate on sites from a particular country via "cr" param, e.g. in Custom Element it looks like this:
<gcse:search cr="gb"></gcse:search>
Google knows some synonyms on the web, but if your particular use case is not correctly recognized you can add it in Control Panel in Search Features > Synonyms
More on synonyms:
Sorry, I ended up answering this myself. I couldn't get any of the instructions under the custom search API itself to work (although the answer offered above was also mentioned there, but this just made my CSE Context XML apparently invalid), but you can make requests to a custom search engine by using the instructions here https://developers.google.com/custom-search/json-api/v1/using_rest and an API key.
This is how I did it;
<gcse:search cr="countryUK"></gcse:search>
You can even return results in a specific language, code shown below returns results only in french;
<gcse:search lr = "lang_fr"></gcse:search>
This is the reference for Google Custom Search Element Control API: https://developers.google.com/custom-search/docs/element?hl=en
Try to set the 'gl' parameter to the country you want.
For details, look into CSE:list

Google Custom Search API curl trouble

I'm a newbie at stackoverflow so please be patient with me :)
I'm trying to get access with the Google Custom Search API.
But I get return that I can't understand.
My query is like this:
https://www.googleapis.com/customsearch/v1?&key=********&q=red%2Bsox&cx=**********&start=0&num=10&cr=countryCA&lr=lang_fr&client=google-csbe&output=xml_no_dtd
And the result I get is this?
string '{"error": {"errors": [{"domain": "global","reason": "invalid","message": "Invalid Value"}],"code": 400,"message": "Invalid Value"}}' (length=172)
What am I doing wrong?
I want the result from Google to appear.
Thanks in advance :)
You don't have a cx.
Take a look at this answer
What happens is because this api is used mostly for adding a search option
for your site you have to specify you custom search engine (e.g. search only your site).
When you want this to search the web by code you need to do the above. Add a fake
site (where you would add your search textbox), configure it (search the web, or your site, or whatever else) and then delete the fake site
Update
Oh god, i just saw that. Sorry. Well the problem is that you start with 0. Valid is 1. Change start=0 with start=1 and i think you would be good to go. Take a look at this for valid values for the start parameter official page

how to correct spelling mistakes in Google custom API

I am using Google's custom search API, I make an HTTP request to a URL that looks like this:
https://www.googleapis.com/customsearch/v1?key=<my-key>&cref=&num=10&q=how+can+i+do+htis
if you search for "how can i do htis" on Google you are told "Showing results for how can i do this", and give you some results (call them result set A)
but if you use the API to search for the misspelled string, you get different results than those of A... Searching with a correctly spelled string gives you result A, which matches the ordinary search service on Google
Is there a way to search directly using the suggested string? I want to use the API I can't afford implementing a spell checker myself that can also correct people names and everything
I think what you want to do is possible using the spelling suggestions of Google. This is part of the xml-results returned by your query.
See API here.