Thank you for the quick answer, Julian! Works like a dream. Best,
Frank
On Sep 14, 9:21 am, "Julian (Google)" <[email protected]> wrote:
> Hi Frank,
>
> You can define:
> GDATA_VER_HEADER = 'GData-Version'
>
> Or you can use the following:
> additional_headers = {'GData-Version': 3}
>
> Cheers,
> Julian.
>
> On Sep 12, 3:43 am, Frank <[email protected]> wrote:
>
>
>
> > Sorry Julian, I am missing something obvious here - I tried:
>
> > client = gdata.contacts.service.ContactsService(additional_headers =
> > {GDATA_VER_HEADER: 3})
>
> > But got: name 'GDATA_VER_HEADER' is not defined
>
> > Have checked archive & PyDocs but am not very experienced with the
> > GData API.
>
> > Many thanks,
> > Frank
>
> > On Sep 11, 2:30 pm, "Julian (Google)" <[email protected]> wrote:
>
> > > Hi,
>
> > > To get the birthday you need to use the Contacts API v3, add the
> > > following additional headers when you create a contacts service
> > > instance:
>
> > > additional_headers = {GDATA_VER_HEADER: 3}
>
> > > Cheers,
> > > Julian.
>
> > > On Sep 8, 5:33 am, hamx0r <[email protected]> wrote:
>
> > > > hi, I have some code that allows me to dump contacts details for a
> > > > user-provided contact name. This is written in Python. The problem
> > > > is that even when I put in a known contact name, the script returns
> > > > None for the birthday. Can anyone see what's wrong with this code?
> > > > Is the birthday attribute of an entry supposed to be readable with
> > > > just "contact.birthday"?
>
> > > > def getByName(self):
> > > > name = raw_input('Name to search? ')
> > > > query = gdata.contacts.service.ContactsQuery()
> > > > query.max_results = 2000
> > > > feed = self.gd_client.GetContactsFeed(query.ToUri())
> > > > #roll through all the contacts
> > > > for i, entry in enumerate(feed.entry):
> > > > nameStr = '%s' % entry.title.text
> > > > emailAddie = "<none>"
> > > > #when we find a matching contact, spit out it's email address,
> > > > organization info and birthday
> > > > if nameStr == name:
> > > > for email in entry.email:
> > > > if email.primary == 'true':
> > > > emailAddie = email.address
> > > > break
>
> > > > print ( '%s\t%s' % (entry.title.text, emailAddie))
> > > > if entry.organization:
> > > > print entry.organization.org_title.text + "\t" +
> > > > entry.organization.org_name.text
> > > > if entry.birthday:
> > > > print entry.birthday
> > > > return
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Contacts API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-contacts-api?hl=en
-~----------~----~----~----~------~----~------~--~---