2013-01-16 105 views
0

我正在使用FB API和FQL来获取识别用户的某些事件代码。获取Facebook活动页面

但是我想表明Facebook的活动页面,但我不能找到这样做的方式......

下面的例子:

I go to mywebsite.com, and I login into Facebook. 
I get a list of all my current events, with a Link 
If I follow this link, I get the event ID (1234567, for example) 
[this step is the one I want to do]: 
I show in my website (like if it was an iframe) the following FB page: 
    https://www.facebook.com/events/1234567 

所以,与我想允许用户直接与Facebook交互,但不会离开我的网站...

我该怎么做?可能吗?

谢谢!

+0

不可能。 Facebook不允许您将他们的网站放入框架中。 – cpilko

回答

0

解决!

function viewFBActivity($id){ 
    $h = curl_init("https://www.facebook.com/events/".$id."/"); 
    curl_setopt($h, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); 
    curl_setopt($h, CURLOPT_HEADER, false); 
    curl_setopt($h, CURLOPT_HTTPHEADER, array("Accept-Language: es-es,en")); 
    curl_setopt($h, CURLOPT_SSL_VERIFYPEER, false); 
    curl_setopt($h, CURLOPT_SSL_VERIFYHOST, false); 
    curl_setopt($h, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); 
    curl_setopt($h, CURLOPT_RETURNTRANSFER, true); 
    curl_setopt($h, CURLOPT_AUTOREFERER, true); 
    $ret= curl_exec($h); 
    echo($ret); 
} 

我希望它可以帮助未来的人!