简体   繁体   English

如何在我的网站上更新用户的Facebook朋友?

[英]How to update a user's friends from facebook on my site?

I have an app in Rails and I have it configured so that when a user logs into my app, a list of their facebook friends who have authorized my app is stored in my database so that I can display this info to the user. 我在Rails中有一个应用程序,我已对其进行配置,以便当用户登录我的应用程序时,已经授权我的应用程序的Facebook好友列表存储在我的数据库中,以便我可以向用户显示此信息。

But does anyone have any best practices for keeping this information up to date? 但有没有人有任何最佳做法来保持这些信息是最新的? For example, if user A and user B both use my app, and user A adds user B as a friend, how can I ensure that user B is displayed on user A's friend list? 例如,如果用户A和用户B都使用我的应用程序,并且用户A将用户B添加为朋友,我如何确保用户B显示在用户A的朋友列表中?

I know that I could query facebook every time that I display a user's friends list but the main reason for storing a user's facebook friends in the database is to increase performance and prevent having to make this kind of call each time a user clicks through. 我知道每次显示用户的朋友列表时我都可以查询facebook,但是将数据库中的用户的Facebook朋友存储的主要原因是为了提高性能并防止每次用户点击时都要进行此类调用。 Any ideas or best practices? 任何想法或最佳做法?

maybe have a scheduled task to update that information maybe every day or week? 可能有一个计划任务,可能每天或每周更新该信息?

Here is one gem for helping on that https://github.com/bvandenbos/resque-scheduler/ 这是帮助https://github.com/bvandenbos/resque-scheduler/的一个宝石

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用php将用户信息从facebook sdk提取到我网站的数据库中 - how to pull user information from facebook sdk into my site's database using php 如何使用PHP在MySQL中存储Facebook用户的朋友列表? - How to store a Facebook user's friends list in MySQL using PHP? facebook如何存储用户的好友? - How does facebook store the friends of a user? 如何让我的朋友和朋友的朋友? - How to get both my friends & friends of friends? 如何从朋友表中获取朋友列表,其中包含我朋友的朋友数 - How do I get friend list from Friends table with counts of friends of my friends 如何让我的删除消息功能仅出现在留在其朋友页面上的用户自己的消息中? - How can I get my delete messages function just appear for the user's own messages left on their friends page? 在表中有成对的朋友,如何制作一个视图来抽象获取用户的朋友列表? - having pairs of friends in table, how to make a view that would abstract getting list of user's friends? 如何使用Graph API获取用户朋友的个人资料ID - How to get profile Id of user's friends using Graph API 如何在php和MySQL中获取用户的朋友数据? - How to get user's friends data in php and MySQL? 当用户失去与站点的连接时,如何更新mysql字段? - How can I update a mysql field when my user loses connection to my site?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM