抱歉这个奇怪的问题。 我是一个非常有用的Facebook群组的管理员。有许多有价值的信息,我想离线。是否有任何(cli)方法可以下载它?
答案 0 :(得分:1)
您可以使用Sociograph和Grytics等在线服务获取数据甚至导出数据(我尝试过社交网站)。
如果您想自己下载数据,那么您需要构建一个程序,通过图形api为您获取数据,然后您可以从中获得所需的数据。
这是一个简单的我在python中入侵以从facebook组获取数据。 使用此SDK
#!/usr/bin/env python3
import requests
import facebook
from collections import Counter
graph = facebook.GraphAPI(access_token='fb_access_token', version='2.7', timeout=2.00)
posts = []
post = graph.get_object(id='{group-id}/feed') #graph api endpoint...group-id/feed
group_data = (post['data'])
all_posts = []
"""
Get all posts in the group.
"""
def get_posts(data=[]):
for obj in data:
if 'message' in obj:
print(obj['message'])
all_posts.append(obj['message'])
"""
return the total number of times each word appears in the posts
"""
def get_word_count(all_posts):
all_posts = ''.join(all_posts)
all_posts = all_posts.split()
for word in all_posts:
print(Counter(word))
print(Counter(all_posts).most_common(5)) #5 most common words
"""
return number of posts made in the group
"""
def posts_count(data):
return len(data)
get_posts(group_data) get_word_count(all_posts) 基本上使用graph-api,您可以获得有关该组的所有信息,例如每个帖子上的喜欢,喜欢什么,视频数量,照片等,并从那里扣除。
我用谷歌搜索但找不到一个bash脚本。