Skip to content

Instantly share code, notes, and snippets.

@necenzurat
Last active August 29, 2015 14:19
Show Gist options
  • Save necenzurat/106089093daaba785b0a to your computer and use it in GitHub Desktop.
Save necenzurat/106089093daaba785b0a to your computer and use it in GitHub Desktop.
căcatul Oanei, no 2
<?php
/*
1. https://graph.facebook.com/949954348389919
2. https://graph.facebook.com/950516285000392
3. https://graph.facebook.com/951077058277648
*/
$post_id = "949954348389919";
$url = "https://graph.facebook.com/v1.0/$post_id/comments?pretty=1&limit=6000";
$data = file_get_contents($url);
$json = json_decode($data, true);
foreach ($json["data"] as $comment) {
$date = date( "d-m-Y G:i" , strtotime($comment["created_time"]));
$name = $comment["from"]["name"];
$url = "http://facebook.com/".$comment["from"]["id"];
$message = $comment["message"];
$like = $comment["like_count"];
echo '"'.$date.'", "'.$name.'", "'.$url.'", "'.$message.'", "'.$like.'"';
echo "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment