接續上週,但有edit功能 blogger https://2019wcm.blogspot.com/search/label/blogger 影片 https://drive.google.com/file/d/13KBfWIMULL9fAPw-T54cExMt9GUTW4XZ/view 開啟編輯器預備 打開黑黑的窗格(我還是習慣這樣叫ww),git submodule: pip install google-api-python-client pip install oauth2client 將下列程式碼打進編輯器: ''' 用來測試 Google Blogger Python API 新增文章程式 pip install google-api-python-client oauth2client ''' import sys from oauth2client import client from googleapiclient import sample_tools argv = "" 認證並建立服務 service, flags = sample_tools.init( argv, 'blogger', 'v3', doc , './client_secrets.json', scope='https://www.googleapis.com/auth/blogger') try: users = service.users() # 取得使用者 profile 資料 user = users.get(userId='self').execute() print('網誌名稱: %s' % user['displayName']) blogs = service.blogs() # 取得使用者所建立網誌名稱 blogs = blogs.listByUser(userId='self').execute() for blog in blogs[...
留言
張貼留言