2
Google API gdataのブログ機能を使用しようとしています。私はドキュメンテーションの後にベストを尽くしたが、とてもうまくいかなかった。誰も私にどのように私はGoogleのブロガーAPIを使用することができます教えていただけますか?私のコードはかなり混乱していて、今私は手がかりから外れています。PythonでGoogle Blogger APIを使用するには?
EDIT FULL WORKING CODE :):
from oauth2client.client import OAuth2WebServerFlow
import httplib2
from apiclient.discovery import build
from oauth2client.file import Storage
#flow = OAuth2WebServerFlow(client_id='', #ID
# client_secret='', #SECRET ID
# scope='https://www.googleapis.com/auth/blogger',
# redirect_uri='urn:ietf:wg:oauth:2.0:oob')
#auth_uri = flow.step1_get_authorize_url()
# Redirect the user to auth_uri on your platform.
# Open a file
#fo = open("foo.txt", "wb")
#fo.write(auth_uri +"\n");
#fo.close()
#credentials = flow.step2_exchange(raw_input ())
storage = Storage('a_credentials_file')
#storage.put(credentials)
credentials = storage.get()
http = httplib2.Http()
http = credentials.authorize(http)
service = build('blogger', 'v3', http=http)
users = service.users()
# Retrieve this user's profile information
thisuser = users.get(userId='self').execute()
print('This user\'s display name is: %s' % thisuser['displayName'])
(http://stackoverflow.com/help/how-to-ask)[HOW-TO-お願い】読み、その後、追加してください。あなたの質問に関連する情報"私は非常にひどく失敗しました"とは、特定のプログラミング上の問題ではありません。 – Mailerdaimon
私はちょうどこのAPIを使用する手がかりがありません: 'https:// developers.google.com/blogger/docs/3.0/api-lib/python'これらの関数を使いたい:' https:// developers.google.com/apis-explorer /#p/blogger/v3/'しかし、私は' aouth 2.0'で動作させる方法を知らない。 – ryspbsk
OAuthガイドを読んだことはありますか? https://developers.google.com/api-client-library/python/guide/aaa_oauth – Mailerdaimon