pygoogle search restricted by date

wtr wtri at wtresearch.de
Thu Jun 6 05:32:53 EDT 2002


Hi,
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.
Bye,
wolfgang teschner

"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
date
> range using "daterange:<date1>-<date2>" where date1 and date2 are Julian
Day
> Numbers. I put the term in the restrict part auf the doGoogleSearch
function
> (-> code snippet). Nevertheless I'm getting the same results.
>
> Any hints?
>
> Lutz
>
> <--snip-->
>
> import google
> from mx.DateTime import *
>
> google.setLicense('<mykey>')
> 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 mailing list