Skip to content

Instantly share code, notes, and snippets.

@fleeting
Created February 27, 2010 04:29
Show Gist options
  • Save fleeting/316476 to your computer and use it in GitHub Desktop.
Save fleeting/316476 to your computer and use it in GitHub Desktop.
$user_api_key = "agsr63Q9NlwKxUsHQSFFolD2gDWTfk7eN1Il0dhbXQH5FLHVy2VEKvvmnJsdNxYs";
$forum_api_key = NULL;
$api_url = 'http://disqus.com/api/';
$api_version = '1.1';
//http://disqus.com/api/get_forum_list?user_api_key=API_KEY_HERE&api_version=1.1
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url . 'get_forum_posts/?user_api_key='.$user_api_key.'&forum_id=242057&api_version='.$api_version);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
$data = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
$disqus_comments = json_decode($data, true);
if ($info['http_code'] == 200) {
echo "<pre>";
print_r($disqus_comments);
echo "</pre>";
} else {
echo "There was a problem accessing the Disqus API.";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment