@@ -24,6 +24,7 @@ categories = ['general']
24paging = True
24paging = True
25language_support = True
25language_support = True
26use_locale_domain = True
26use_locale_domain = True
27+time_range_support = True
28# based on https://en.wikipedia.org/wiki/List_of_Google_domains and tests
29# based on https://en.wikipedia.org/wiki/List_of_Google_domains and tests
29default_hostname = 'www.google.com'
30default_hostname = 'www.google.com'
@@ -92,6 +93,11 @@ search_url = ('https://{hostname}' +
92 search_path +
93 search_path +
93 '?{query}&start={offset}&gws_rd=cr&gbv=1&lr={lang}&ei=x')
94 '?{query}&start={offset}&gws_rd=cr&gbv=1&lr={lang}&ei=x')
96+time_range_search = "&tbs=qdr:{range}"
97+time_range_dict = {'day': 'd',
95# other URLs
101# other URLs
96map_hostname_start = 'maps.google.'
102map_hostname_start = 'maps.google.'
97maps_path = '/maps'
103maps_path = '/maps'
@@ -179,6 +185,8 @@ def request(query, params):
179 query=urlencode({'q': query}),
185 query=urlencode({'q': query}),
180 hostname=google_hostname,
186 hostname=google_hostname,
181 lang=url_lang)
187 lang=url_lang)
188+ if params['time_range']:
189+ params['url'] += time_range_search.format(range=time_range_dict[params['time_range']])
183 params['headers']['Accept-Language'] = language
191 params['headers']['Accept-Language'] = language
184 params['headers']['Accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
192 params['headers']['Accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'