google-custom-search

Specifying a Date Range in Google Custom Search api

冷暖自知 提交于 2019-12-08 10:10:39
问题 Its trivial to search a set of keywords in a certain website in a specific date range -> in the google search box you enter: desired-kewords site:desired-website then from the Tools menu you pick the date range. e.g. here "arab spring" search term in www.cnn.com between 1th Jan 2011 and 31th Dec 2013: As you can see in the second picture there are about 773 results! the search URI looks like this : https://www.google.co.nz/search?tbs=cdr%3A1%2Ccd_min%3A1%2F1%2F2011%2Ccd_max%3A12%2F31%2F2013

Search image on Google images with the new Custom Search API?

北慕城南 提交于 2019-12-08 08:56:08
问题 So, I am testing this piece of code : import requests import json searchTerm = 'parrot' startIndex = '0' searchUrl = "http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=" + \ searchTerm + "&start=" + startIndex r = requests.get(searchUrl) response = r.content.decode('utf-8') result = json.loads(response) print(r) print(result) And the response is : <Response [200]> {'responseData': None, 'responseStatus': 403, 'responseDetails': 'This API is no longer available.'} Seems that I am

Multiple file types search using Google Custom Search API

安稳与你 提交于 2019-12-08 00:29:36
问题 I need to get Google search results for particular filetypes. For example, in browser I would directly google search for " hyperloop filetype:pdf " and it will list out PDF files for "Hyperloop". For this, my Google Custom Search request URI will be https://www.googleapis.com/customsearch/v1?key=MY_KEY&cx=MY_UNIQUE_ID&q=hyperloop&fileType=pdf However, currently I would like to get search results for "hyperloop" of filetypes .ppt or .doc. In browser, I would achieve this by googling "

Google custom search using multiple search labels - refinements?

折月煮酒 提交于 2019-12-07 12:43:11
问题 With google custom search, one can refine results to a label by using the more: operator like so: searchterm more:blog But how can one restrict results to more than one label? It seems like this should work: searchterm more:blog,articles .. but it does not appear to - instead it is ignored as if I had specified an invalid label. 回答1: Based on my research, you cannot use the more: operator in a Google query string for the following reasons: First, Google Custom search documentation on search

How can I set a custom width on my Google search iframe?

荒凉一梦 提交于 2019-12-07 02:40:05
问题 I am trying to use google search for my site: http://www.houseofhawkins.com/search.php It is not playing nice with some screen resolutions. Here is the code given from google: <div id="cse-search-results"></div> <script type="text/javascript"> var googleSearchIframeName = "cse-search-results"; var googleSearchFormName = "cse-search-box"; var googleSearchFrameWidth = 250; var googleSearchDomain = "www.google.com"; var googleSearchPath = "/cse"; </script> <script type="text/javascript" src=

How to specify Image type in Google Custom Search

試著忘記壹切 提交于 2019-12-06 21:24:07
问题 I am using Google Custom Search to get images with some criteria. I am initiating HTTP Get requests from java application to call the Google Custom Search API (Please note I am NOT using javascript or css and I am NOT developing web site). I am able to get the images, and the program is working. the application brings images which has Jpg extension. I want to : bring ONLY the images which has png extension AND has transparent background. I tried to specify the filetype in the query string of

Google Custom Search's refinement doesn't redirect to different website.

↘锁芯ラ 提交于 2019-12-06 13:26:13
I'm using Google Custom Search and trying to use Refinement to redirect search queries to other websites. I follow the example from https://developers.google.com/custom-search/docs/refinements#redirect but it doesn't work. When I click a refinement link (tab), instead of redirecting, it just shows "No Results" on the same page. Here is my XML CSE Context code: <?xml version="1.0" encoding="UTF-8" ?> <CustomSearchEngine id="<my_search_engine_id>" creator="<my_creator_id>" language="en" encoding="UTF-8" enable_suggest="true"> <Title>my.domain.name</Title> <Context> <Facet> <FacetItem title=

How to replace google custom search engine's magnifying glass with a button that says “search”?

柔情痞子 提交于 2019-12-06 08:38:32
问题 I'm using the basic code and the standard "compact" theme for GCSE: <script> (function() { var cx = '111111111111111111111:11111111111'; var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//cse.google.com/cse.js?cx=' + cx; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s); })(); </script> <gcse:search></gcse:search> This renders the input

Google Custom Search API - Engine Retrieving Engine Data Fails

空扰寡人 提交于 2019-12-06 07:19:52
问题 I need to do CRUD on Custom Search Engines. From documentation, it looks pretty straight forward. I keep getting 401 responses though. I am using Google.Apis.Oauth2.v2 to get a token: String serviceAccountEmail = "blahblahblah@developer.gserviceaccount.com"; var certificate = new X509Certificate2(@"key.p12", "blah", X509KeyStorageFlags.Exportable); var credential = new ServiceAccountCredential( new ServiceAccountCredential.Initializer(serviceAccountEmail) { Scopes = new[] { "https://www

Google custom search using multiple search labels - refinements?

懵懂的女人 提交于 2019-12-05 18:51:52
With google custom search, one can refine results to a label by using the more: operator like so: searchterm more:blog But how can one restrict results to more than one label? It seems like this should work: searchterm more:blog,articles .. but it does not appear to - instead it is ignored as if I had specified an invalid label. Based on my research, you cannot use the more: operator in a Google query string for the following reasons: First, Google Custom search documentation on search refinement never provides a query string example . Also, custom search is performed via APIs and XML requests