有Event對象上沒有attending_count
場,但有一個attending
邊緣:
爲什麼你想獲得attending_count
上場地的頁面ID ?這沒有什麼意義。
可以使用summary
得到與會者的絕對計數這樣
/217733628398158/events?fields=id,cover,name,venue,description,ticket_uri,start_time,attending.summary(true).limit(1)
爲了減少圖形API我加入了.limit(1)
這是隻有返回每個事件一個與會者返回的數據量,但無論如何產生總結計數。如果您需要整個列表,請刪除limit
參數。
所以,它返回
{
"data": [
{
"id": "326299167565639",
"cover": {
"cover_id": "839491946113340",
"source": "https://scontent-a.xx.fbcdn.net/hphotos-xpa1/t31.0-8/s720x720/10547740_839491946113340_540194689313513221_o.jpg",
"offset_y": 28,
"offset_x": 0
},
"name": "Feeling This • Histórias de verão",
"venue": {
"name": "Lima e Silva, 1037, Porto Alegre"
},
"description": "ARE YOU FEELING THIS?\nÉ a nostalgia da estação quente que tá batendo!\n\nFaça aqui a sua história de verão.\nThese are the best days of our lives!\n\n-\n\nIngressos:\nR$15 com Feeling Cup!*\nR$20 na lista* <http://goo.gl/1I9vV8>\nR$25 na hora\n\n* Lista encerra às 20h do dia da festa. \n* Válido para entrada até 00h\n\n\nQuer comemorar seu aniversário na FEELING THIS? Entre em contato através do e-mail [email protected] para saber das vantagens.",
"ticket_uri": "https://www.facebook.com/ajax/events/ticket.php?event_id=326299167565639&source=12&ext=1421830108&hash=ATX8w7CCSBVhKO6G",
"start_time": "2015-02-04T22:00:00-0200",
"attending": {
"data": [
{
"name": "Foo Pretenders",
"rsvp_status": "attending",
"id": "1395261354109384"
}
],
"paging": {
"cursors": {
"after": "TVRBd01EQTROelkxT1RnMk9UYzBPakUwTWpNd09UUTBNREE2TVRZMU1EZzBPRGsyT0RRNE5UZ3g=",
"before": "TVRBd01EQTROelkxT1RnMk9UYzBPakUwTWpNd09UUTBNREE2TVRZMU1EZzBPRGsyT0RRNE5UZ3g="
},
"next": "https://graph.facebook.com/v2.2/326299167565639/attending?summary=true&limit=1&after=TVRBd01EQTROelkxT1RnMk9UYzBPakUwTWpNd09UUTBNREE2TVRZMU1EZzBPRGsyT0RRNE5UZ3g="
},
"summary": {
"count": 634
}
}
},
....
]
有634人蔘加的特定事件。
謝謝@Tobi!只是爲了討論,這個屬性來自哪裏?它來自Facebook API嗎?你能指點一些關於這樣的其他屬性的文檔嗎? – adolfosrs 2015-01-21 10:53:40
它沒有真正的記錄afaik,只是對象的評論和喜歡的一些邊緣,例如見。 https://developers.facebook.com/docs/graph-api/reference/v2.2/object/comments#readfields – Tobi 2015-01-21 11:11:57
你甚至可以'attending.limit(0).summary(true)':) – 2015-05-09 09:28:19