晚上好,我一直在努力解析这个json,它看起来很容易,但是,最后几行,围绕着comments变量,我唯一能做的就是做一个for循环并输出所有的数据,我希望所有的数据都像“who”和“post”变量的结果。。。只分析了注释。。。谢谢你的帮助。。。在
import facebook
token = "valid access token"
graph = facebook.GraphAPI(token)
# pages = ['Shitty']
profile = graph.get_object("55555555555555555")
# this line would connect us to the facebook profile
whom = graph.get_connections("me", connection_name="feed", fields="from")
for who in whom['data']:
print who['from']['name']
posts = graph.get_connections(id='me', connection_name="feed")
for post in posts['data']:
print post['message']
comments = graph.get_connections('me', connection_name="feed", fields="comments")
for comment in comments['data']:
print comment
下面是我运行上述命令时得到的结果。。。在
^{pr2}$
目前没有回答
相关问题 更多 >
编程相关推荐