I'm extracting wall posts from a facebook group feed, but the only thing I'm interested in is the youtube embed id's. Studying Facebook's Graph API, I can't see if there's an easier way of just extracting the youtube embeds directly?
My current solution seems a bit heavy as there are over 3000 posts on the group wall.
Update: As far as I can see, I need to get the metadata as youtube embed links aren't actually shown in the feed.
This is how I parse the group feed, any idea as how I would go about getting the metadata attachment for a youtube link here?
require '../src/facebook.php';
$appId = 'appid'; //appid from facebook
$secret = 'secretid'; //secret from facebook
$groupId = 'groupid'; //facebook groupid
$facebook = new Facebook(array(
'appId' => $appId,
'secret' => $secret,
'cookie' => true
));
$response = $facebook->api('/'.$groupId.'/feed', array('limit' => 600, 'fields'=>'from,message, created_time'));
print "<div class='facebook-feed-title'>Facebook Feed</div>";
foreach ($response['data'] as $value) {
print "<div class='facebook-from'><a href='http://www.facebook.com/home.php?#!/profile.php?id=".$value['from']['id']."'>".$value['from']['name']."</a> wrote:</div>";
print "<div class='link'>".$value['message']."</div>";
}