从Facebook获取所有用户和用户的朋友的视频,并存储数据库 [英] Fetching all user and user friend's videos from facebook and store it Database

查看:116
本文介绍了从Facebook获取所有用户和用户的朋友的视频,并存储数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用rails,我需要从Facebook获取所有用户视频和用户朋友的视频,并将其存储在我们的数据库中。

I am using rails and I need to fetch all user videos and user friend's videos from facebook and store it in our database.

视频就像


  1. 用户和用户朋友喜欢的视频

  2. 用户和用户朋友的共享视频

  3. 用户和用户朋友的已标记视频

  4. 用户和用户朋友的评论视频

  5. 用户和用户朋友上传的视频等

  1. User and user friend's liked videos,
  2. User and user friend's shared videos,
  3. User and user friend's tagged videos,
  4. User and user friend's commented videos,
  5. User and user friend's uploaded videos, etc

所以有什么容易的方法可以同时检索所有这些视频?

So Is there any easy method to retrive all these videos at same time?

推荐答案

用户流中的视频将在流对象中(请参阅 https://developers.facebook.com/docs/reference/fql/stream/ )。在Graph API资源管理器中使用fql?q = {您的查询}查看结果。您可以使用其中子句来回放各种分组。但是,根据我的经验,要获得所有5类视频,您必须运行多个查询。请参阅有关多查询查询的文档(在这个旧的REST API文档中的好例子): https: //developers.facebook.com/docs/reference/rest/fql.multiquery/ )一些非弃用的API支持此功能。

Videos in the user's stream will be in the stream object (see https://developers.facebook.com/docs/reference/fql/stream/). Play around in the Graph API explorer using fql?q={your query here} to see the results. You can play around with the where clause to get various groupings back. However, from my experience, to get all 5 categories of videos, you will have to run multiple queries. See documentation on multiquery query (Good examples here on this old REST API documentation: https://developers.facebook.com/docs/reference/rest/fql.multiquery/) Some of the non deprecated APIs support this.

记住Graph API资源管理器是您的朋友。

Remember the Graph API explorer is your friend.

这篇关于从Facebook获取所有用户和用户的朋友的视频,并存储数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆