Google blogger data API
Google公佈讓python client端存取blogger資訊的library.
安裝環境
- python, 請到官網尋找對應os的安裝方式。( http://www.python.org )
- 安裝 ElementTree (python 2.5 之前的版本才需要)
- 安裝 Google data library
Hello gdata
列出所有 google document 文件的範例,ClientLogin() 部份請改成合法的帳號密碼.
import gdata.docs.service# Create a client class which will make HTTP requests with Google Docs server.client = gdata.docs.service.DocsService()# Authenticate using your Google Docs email address and password.client.ClientLogin('accound@gmail.com', 'password')# Query the server for an Atom feed containing a list of your documents.documents_feed = client.GetDocumentListFeed()# Loop through the feed and extract each document entry.for document_entry in documents_feed.entry: # Display the title of the document on the command line. t = document_entry.title.text.decode('utf-8') print t.encode('utf-8')
沒有留言:
張貼留言