posters.py 文件源码

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

项目:meteosangue 作者: meteosangue 项目源码 文件源码
def facebook_status(status, image_path=None):

    tags = [_generate_tag(ass['facebook_id']) for ass in settings.BLOOD_ASSOCIATIONS if 'facebook_id' in ass]
    try:
        graph = facebook.GraphAPI(settings.FACEBOOK_TOKEN)
        if image_path:
            graph.put_photo(image=open(image_path, 'rb'), message=status, tags=json.dumps(tags))
        else:
            graph.put_wall_post(status)
    except Exception as ex:
        raise MeteoSangueException(ex)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号