我已经尝试使用我在谷歌上找到的示例代码..
import facebook
def main():
# Fill in the values noted in previous steps here
cfg = {
"page_id" : "XXXXXXXXXXXXXX", # Step 1
"access_token" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" # Step 3
}
api = get_api(cfg)
msg = "Hello, world!"
status = api.put_wall_post(msg)
def get_api(cfg):
graph = facebook.GraphAPI(cfg['access_token'])
# Get page token to post as the page. You can skip
# the following if you want to post as yourself.
resp = graph.get_object('me/accounts')
page_access_token = None
for page in resp['data']:
if page['id'] …Run Code Online (Sandbox Code Playgroud)