hello_world.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:python-facebook-api-example 作者: DEV3L 项目源码 文件源码
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'] == cfg['page_id']:
            page_access_token = page['access_token']
    graph = facebook.GraphAPI(page_access_token)
    return graph
    # You can also skip the above if you get a page token:
    # http://stackoverflow.com/questions/8231877/facebook-access-token-for-pages
    # and make that long-lived token as in Step 3
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号