gpt4 book ai didi

facebook graph api - 搜索事件

转载 作者:行者123 更新时间:2023-11-30 05:22:02 24 4
gpt4 key购买 nike

在事件搜索中,查询仅按事件名称搜索: sample http://graph.facebook.com/search?q=party&type=event

  • 有没有办法查询事件描述?还是其他领域?

我尝试使用 until 或 since,但我得到了相同的结果 https://graph.facebook.com/search?q=party&type=event&until=todayhttps://graph.facebook.com/search?q=party&type=event&until=yesterday

  • FQL 只接受按事件 ID 搜索

最佳答案

搜索返回搜索中返回的所有事件的 ID。使用 https://graph.facebook.com/search?q=party&type=event&until=today&fields=id您可以将 id 结果循环到 https://graph.facebook.com/eventid?access_token=yourapptoken获取事件数组,其中包括描述、名称、图像等;

页面和事件搜索的实时示例: http://shawnsspace.com/plugins/plugins.searcher.php

引用: http://developers.facebook.com/docs/reference/api/event/

示例代码:假设页面上安装了 PHP-SDK 3.1.1。

事件 https://graph.facebook.com/search?q=conference&type=event


  <?php
$qi = urlencode($_GET['qs']);
if(!$_GET['qs']){
$qi = urlencode($_POST['qs']);
if(!$_POST['qs']){
$qi = "party";
}
}
$search = $facebook->api('/search?q='.$qi.'&type=event&limit=10');
foreach ($search as $key=>$value) {
$i=1;
foreach ($value as $fkey=>$fvalue) {
$i++;
if($fvalue[id]=="h"){
}else{
$id = $fvalue[id];
$searchResp = $facebook->api('/'.$id.'');
$name = $searchResp[name];
$location = $searchResp[location];
$desc = $searchResp[description];
$sTime = $searchResp[start_time];
$eTime = $searchResp[end_time];

echo $name. '<br />';
echo $location. '<br />';
echo $sTime. '<br />';
echo $eTime. '<br /><hr />';
}
};
};
?>
<form id="getsearch" method="post" action="yourpage.php">
<input type="text" value="" name="qs" id="searchbox" onclick="this.value='';" style="padding: 2px;" size="48">
<input type="submit" value="Search" style="padding: 3px;">
</form>

关于facebook graph api - 搜索事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7199498/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com