pygoogle search restricted by date
wtri at wtresearch.de
Thu Jun 6 05:32:53 EDT 2002
maybe what mx is thinking what a Julian Date is does not
match what Google expects it to be.
What values are given for today?
The complete Julian Date is a very large number, counting days since
more than 6700 years. Sometimes, Julian Dates are given just as offset
of the current year, i.e. day number in year.
"Lutz Schroeer" <ifls at rz.tu-clausthal.de> wrote in message
news:adfmsk$205i$1 at ariadne.rz.tu-clausthal.de...
> Hi Pythonistas,
> The Goolge API doc tells me that I can restrict my search to a specific
> range using "daterange:<date1>-<date2>" where date1 and date2 are Julian
> Numbers. I put the term in the restrict part auf the doGoogleSearch
> (-> code snippet). Nevertheless I'm getting the same results.
> Any hints?
> import google
> from mx.DateTime import *
> today = int(now().jdn)
> yesterday = today - 1
> restrict_query = 'daterange:%d-%d' % (yesterday, today)
> data = google.doGoogleSearch('python', restrict = restrict_query)
> for x in data.results:
> print x.title, x.URL
More information about the Python-list