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
评论列表
文章目录