Originally posted by CreativityKills
View Post
Help: Style data after getting it from Facebook Graph API
Collapse
X
-
if i needed to tell him that it would have implied i thought he was a dumbassOriginally posted by Ponick View PostIf u use fb sdk u may have to enter ur secret key :p
Leave a comment:
-
Download the facebook php sdk from github, it takes care of everything on the inside, all you have to do is make calls and it adds the tokens simple.Last edited by CreativityKills; 19.05.11, 09:06.
Leave a comment:
-
I really don't know how you mean. Intsead of learning something, I only get more confused.Originally posted by CreativityKills View Posti assume u already knw hw to get the stream so heres what u can do:
Can it be fetched using Graph API. I can't understand the "access token" yet...
Leave a comment:
-
Then add the arrGet function:
PHP Code:function arrGet(array $array, $key, $default = null){
return (isset($array[$key]) AND ! empty($array[$key])) ? $array[$key] : $default;
}
Leave a comment:
-
i assume u already knw hw to get the stream so heres what u can do:
PHP Code:
<table>
<?php
$data = $facebook->api('/me?limit=10');
foreach($data as $k => $v){
$pic = '<img src="'.arrGet($v, 'picture', 'no_photo.jpg').'"/>';
$full_name = arrGet($v['from'], 'name', 'No name');
$msg = arrGet($v, 'message');
$link = arrGet($v, 'link', FALSE);
$link = $link ? '<a href="'.$link.'">'.arrGet($v, 'name', $link).'</a>' : null;
$desc = arrGet($v, 'description', null);
$caption = arrGet($v, 'caption', null);
$likes = arrGet($v, 'likes', FALSE);
$likes = $likes ? arrGet($v['likes'], 'count') : 'No';
$cmts = arrGet($v, 'comments', FALSE);
$cmts = $cmts ? arrGet($v['comments'], 'count') : 'No';
?>
<tr>
<td><?=$pic ?></td>
<td colspan="2">
<?=$full_name ?> <?=$msg ?><br />
<?=$link ?><br />
<?php echo $caption ? $caption.'<br/>' : null ?>
<?=$desc ?><br/>
<div align="right">
<?=$likes.' Likes' ?> | <?=$cmts.' Comments' ?>
</div>
</td>
</tr>
<?php
}
?>
</table>Last edited by CreativityKills; 11.05.11, 14:44.
Leave a comment:
-
Help: Style data after getting it from Facebook Graph API
Hello all,
as said on Facebook Developers page, pointing your browser at http://graph.facebook.com/ervis.mysterio/feed will get my Facebook feeds.
Anyone has a script or a clear logic how to style this data? I am trying many ways with PHP expressions but no result till now... And time passes fast...
(p.s.: No suggestion to use secret key please, because I need this way)Tags: None
Leave a comment: