2015-04-02 34 views
1

如何使用Facebook Graph API獲取Facebook標籤源?我想獲取特定#HashTag的所有帖子。Facebook標籤源PHP PHP cURL

我嘗試下面的代碼:

<?php 
    $keyword = '#TagName'; 
    $graph_url = "https://graph.facebook.com/search?type=post&access_token=xxx&q=$keyword"; 

    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_URL, $graph_url); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); 
    curl_setopt($ch, CURLOPT_HEADER, 0); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
    $result = curl_exec($ch); 
    curl_close($ch); 
    var_dump($result); 

?> 

但它返回一個錯誤:

string(82) "{" error":{"message":"No node specified","type":"GraphMethodException","code":100}}" 

許可授予:read_stream

這方面的任何解決方案?謝謝

回答