facebook api:计算活动的参加者数量(限制问题)
好吧,通常我对 facebook API 没什么问题,但我遇到了一个让我想知道的问题。 (我认为这是一个错误(检查票证 http://bugs.developers.facebook。 net/show_bug.cgi?id=13694),但如果有人有想法,我想把它扔在这里)。
我正在使用 facebook PHP 库来计算特定活动的所有与会者,
$attending = $facebook->api('/'.$fbparams['eventId'].'/attending');
这可以正常工作,它可以正确返回包含所有与会者的数组...
现在问题是:
此活动现在有大约 18.000 名与会者。 API 调用返回最多 992 名与会者(而不是应有的 18000 人)。
我尝试
$attending = $facebook->api('/'.$fbparams['eventId'].'/attending?limit=20000');
进行测试,但它没有改变任何东西。
所以我真正的问题是:
如果我无法通过使用图形 api 让它工作,什么是一个好的替代方案? (也许解析事件页面的 html?)现在我每隔几个小时手动更改该值,这是乏味且不必要的。
Okay normally I'm all fine about the facebook API but I'm having a problem which just keeps me wondering. (I think it's a bug (Check ticket http://bugs.developers.facebook.net/show_bug.cgi?id=13694) but I wanted to throw it here if somebody has an idea).
I'm usng the facebook PHP library to count all attendees for a specific event
$attending = $facebook->api('/'.$fbparams['eventId'].'/attending');
this works without a problem it correctly returns an array with all attendees...
now heres the problem:
This event has about 18.000 attendees right now.
The api call returns a max number of 992 attendees (and not 18000 as it should).
I tried
$attending = $facebook->api('/'.$fbparams['eventId'].'/attending?limit=20000');
for testing but it doesn't change anything.
So my actual question is:
If I can't get it to work by using the graph api what would be a good alternative? (Parsing the html of the event page maybe?) Right now I'm changing the value by hand every few hours which is tedious and unnecessary.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
实际上有两个参数,
limit
和offset
。我认为您必须同时使用两者并继续拨打电话,直到其中一个返回的值小于最大值。限制。像这样的东西,但是采用递归方法(我正在编写伪代码):
Actually there are two parameters,
limit
andoffset
. I think that you will have to play with both and continue making calls until one returns less than the max. limit.Something like this, but in a recursive approach (I'm writting pseudo-code):
我搜索了很多,这就是我修复它的方法:
请求的网址应类似于 此。
<一href="https://developers.facebook.com/tools/explorer/145634995501895/?method=GET&path=738667559524648%3Faccess_令牌%3D603913936305026%257CyZYvULhJhDcrsVaGzJmendOpHDw%26fields%3Dattending_count%2Cinvited_count&version=v2.2" rel="nofollow">这里是您可以测试它的地方,这是我使用的代码:
I've searched a lot and this is how I fixed it:
The requested URL should look something like this.
Here is where you can test it and here is the code I used:
尝试
SELECT eid , attend_count, unsure_count,all_members_count FROM event WHERE eid ="event"
Try
SELECT eid , attending_count, unsure_count,all_members_count FROM event WHERE eid ="event"