版權聲明

所有的部落格文章都可以在右邊[blog文章原始檔案]下載最原始的文字檔案,並依你高興使用 docutil 工具轉換成任何對應的格式方便離線閱覽,除了集結成書販賣歡迎任意取用,引用

Google blogger data API

Google blogger data API

Google公佈讓python client端存取blogger資訊的library.

  1. Document

安裝環境

  1. python, 請到官網尋找對應os的安裝方式。( http://www.python.org )
  2. 安裝 ElementTree (python 2.5 之前的版本才需要)
  3. 安裝 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')

沒有留言:

Related Posts with Thumbnails