fbtext.py 文件源码

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

项目:gulper 作者: QuantifiedSelfless 项目源码 文件源码
def scrape(self, user_data):
        try:
            oauth = user_data.services['facebook']['access_token']
        except KeyError:
            return False
        graph = GraphAPI(access_token=oauth)
        data = {
            "text": [],
            "links": []
        }

        posts = []
        posts_blob = yield facebook_paginate(
            graph.get_connections(
                'me',
                'posts',
                fields='message, link, created_time'
            ),
            max_results=self.num_posts_per_user
        )
        posts, links = self.message_filter(posts_blob)

        # To do comments we'd have to go through the different posts and look
        # Scraping the person's feed is another option, but we get more garbage
        data['text'] = posts
        data['links'] = links
        return data
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号