有效的领域,而使用Google共享联系人API插入接触使用python
问题描述:
尝试添加联系人下面 是从API 示例代码在那里我能得到像组织等,并针对一些示例Python代码有效的领域?有效的领域,而使用Google共享联系人API插入接触使用python
new_contact = gdata.contacts.ContactEntry(title=atom.Title(text=name))
new_contact.content = atom.Content(text=notes)
# Create a work email address for the contact and use as primary.
new_contact.email.append(gdata.contacts.Email(address=primary_email,
primary='true', rel=gdata.contacts.REL_WORK))
# Add extended properties to add data which is used in your application.
new_contact.extended_property.append(gdata.ExtendedProperty(
name='favourite flower', value='daisy'))
sports_property = gdata.ExtendedProperty(name='sports')
sports_property.SetXmlBlob('<dance><salsa/><ballroom_dancing/></dance>')
new_contact.extended_property.append(sports_property)
# Send the contact data to the server.
contact_entry = gd_client.CreateContact(new_contact)
答
有一个在gdata-python-client source code属性的一个相当完整列表(见PersonEntry和ContactEntry类)和一些example code for using the client为好。
找到Pradeep [link] http://gdata-python-client.googlecode.com/hg/tests/gdata_tests/data_smoke_test.py – coder 2011-06-08 13:12:48