且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

检查哪些用户喜欢Facebook页面

更新时间:2023-12-01 19:27:28

这个问题似乎是一个使用 FQL 。有一个表格叫做 page_fan 作为用户页面表之间的连接表。您可以为每个用户运行查询以查看所选页面是否存在一行。例如:

  SELECT 1 FROM page_fan WHERE uid = me()和page_id = 8484927467 


I've been researching this for a couple of days and I'm seing a lot of answers to similar questions and they are unfortunately all "No, you can't do that." So, perhaps you can help me find a more efficient way or perhaps you have a better answer.

I'm running a game at an event. When users sign up for my game, they'll authorize my Facebook app. They get points in my game for doing certain things. One of the things they get points for is Liking a chosen Facebook page.

They don't Like the page through any interface I control though, so I'm going to be running a process in the background which checks if my authorized users have liked the page.

I'm going to have tens of thousands of people playing this game though. I've got an access_token for each of them and I know I can fetch a list of likes for Person X with their access_token, but fetching 10,000+ lists of likes to check if they've liked the page seems ridiculous... especially since if they haven't liked it, I can't just cross them off the list. I need to keep checking every few minutes for the duration of the event just to see if they have liked the page yet and give them points. Once they have liked the page then I no longer need to keep checking them, but that's still going to require a ton of requests.

Is there a way that I can determine which of my 10k+ users, for whom I have individual access_tokens, have liked my page?

Or can I get list of people who have recently liked a particular page?

Any other suggestions?

EDIT: As the administrator of my FB page, I can use the website to just click through and I can see all of the people who have liked my page, so I feel like there should be some way to access this information programmatically as well. Am I just missing something?

This problem seems like a candidate for using FQL. There's a table called page_fan that acts as a join table between the user and page tables. You could run a query for each user to see whether a row exists for the chosen page. For example:

SELECT 1 FROM page_fan WHERE uid = me() and page_id = 8484927467