似乎没有以任何其他顺序对提要进行排序的方法。
我能看到的唯一方法是下载整个提要并获取您需要的内容...
// Set your access token here...
$accessToken = 'XXX';
// Set your GroupID here...
$groupId = '123';
// Set the number of feed items required here...
$qtyRequired = 10;
$url = 'https://graph.facebook.com/v2.2/' . $groupId . '/feed/?limit=100&access_token=' . $accessToken;
$feed = array();
while ($url) {
// Get the data from Facebook.
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => $url
));
$data = json_decode(curl_exec($curl));
// Store the feed to $feed.
if (is_array($data->data)) $feed = array_merge($feed, $data->data);
// Load the next page or quit.
if (isset($data->paging->next)) $url = $data->paging->next;
else $url = false;
}
// Feed will contain the oldest feed items.
$feed = array_slice($feed, -$qtyRequired);
您可以通过指定所需的确切字段来加快速度。