Skip to content

Instantly share code, notes, and snippets.

@mkjones
Created January 19, 2012 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkjones/1639131 to your computer and use it in GitHub Desktop.
Save mkjones/1639131 to your computer and use it in GitHub Desktop.
scrape the gifs group
<?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