Created
January 19, 2012 09:57
-
-
Save mkjones/1639131 to your computer and use it in GitHub Desktop.
scrape the gifs group
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function fetch($url) { | |
$json = json_decode(file_get_contents($url), true); | |
$data = $json['data']; | |
foreach ($data as $row) { | |
$arr = array( | |
$row['created_time'], | |
$row['message'], | |
$row['link'], | |
$row['likes']['count'], | |
$row['actions'][0]['link'], | |
); | |
echo implode("\t", $arr)."\n"; | |
} | |
return $json['paging']['next']; | |
} | |
$token = 'foo'; // see https://developers.facebook.com/tools/explorer | |
$url = 'https://graph.facebook.com/201636233240648/feed?format=json&access_token='.$token; | |
while ($url) { | |
$url = fetch($url); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment