asked on
<?php
header('Content-Type: text/html; charset=utf-8');
$page_id = 'cnninternational';
$access_token = 'xxxxxxx';
//Get the JSON
$json_object = file_get_contents('https://graph.facebook.com/'.$page_id.'/posts?access_token='.$access_token.'&format=json');
//Interpret data
$fbdata = json_decode($json_object);
?>
‚è5×À4#_rß.²¹ÏÀû-«‹hÎ
M´‹”VÎuK6W•Ð
po6¥üv¢p+¡¿S …QáîÀ&âcÛ6:„6[¡LÖKØãv¡[f-WFNÅ1Y2+¡]t[0°§5„>Nñ¿À;]¤zމ®›T\¿Ù:K¿Å:ÐçÚd»¸®Þ:sŠ‘Œ‘Ì- eP“tá¿åì" õÖj6³Óf¿¿/¿”ÌÇU¿ÉDGC§¦ ûµyÚE÷ÑÍ6½.òpß
ÊøõNmY—Vívëþ\ÍC¹ƒpäSl
ºœ¯¶*¿\;&çûíÁ¤¿Ç4É´‚Ð×÷¿·ßœ”Á0œ¿Î¿^aé…6¾¶èU¯ ¿T.¾ªŸò-Ïjd·øÏ*»å` ¿Wèt„¿²ÝUåë÷S©H‡[Ì4hü•:³¿¦JK:eM]’®2;é É
#”^® &@¿W0½¬'ØÇ3¿y·MicŠé·"[£%~)—I±ˆ¸¡¼8‹\ò5Fu Ý
ÝP‰ÀLö|Zë¿ å5¡áòVI`œc@ ‘L¬";§tÍag?¶¨z‡p˜½˜‘o«°²W [ ’É_Á·‘Û@‹±S%®–o‚Ï?úÆx¥j¿‡â•i=çtZ™n›·rCe)·“k¬K‘À¥¡Ó¿¨+ÆwIÕœ|·.Ç5
"_m¿aC¶C2* «—4ð+áÈÃÖmÛÔz1 ‘ñ¤ù’-€±\ÅG€¨f¨¼êAN§ñ¢ÛYî=c,ú$w¿ú[ø 倿à‚ȪXÏj£©{¤%¢
ÀUØ]hç‰Ë0Ò¿B\19P„1{)º%'@_¸ñ¿Ïo=:®ìgx »Ì
¿¹ '¾z
ýÃøwƒ ¿
œ6U²ó æüƒT¡ï…8 ¿ÜÛ&ˆÛú_èâÃî0ƒ¨u}nÊóU{wß`—²ƒØÍñWÛmÛùÉP %"?’óI¿Á¼–f³:S¤8¾é–¶)¿@F¯¿€bÃDJK+JA›0ß™L
À®Ž ÔT¢®1q¡aæ–@ù)¦>$Àñôa6E‚2¯.ÁbË>4þöS‰³ålûA:•´Ãîñÿ÷#“³%ãèeòPÂæ±Ó«¾å0dÊ
Ñ.€Î@G‚
} ðMWŒ#õx.Ò 3©¥\ Q
£¿ 0Âöú·8ÿðo¼¨»«hžÙj¬v^‹»mo¬ÚâX—n"ÿ™[,óC¼À
r5q:/T—«*AØx#U/„åP>|žqY¼ztŒbÈê_Ä¿øÜCIþù§ëãëç…ýÖ1ža%pÛæ¿_¿_ÜaוÿLàU2⯨ä—}I<‘Üôƒªlt¿GöÇ_‹¤q¿>ê}<½8~+Fë6¯aÁng†žÔC^1 ÌNÙYå):PI,®žä²¾ê
”ä ¿Ùs@É ¹\cQÿ1Jíu(zyC
í;ðj†
¼ZøÿQ3—¿.ø.HkÂzŸóÚ@sØ¿q¡wQw4å²Cæó©¶59ë*“i^G—xÁ†_çþœ~Cï¢Ýw™ãóÌs9kT~þÎ,½
ºÜo@uLË6]¿ë8¯ÚÑS
í8uRÔT%ëq¿¤ù&µ¿¿Jä©Ìhw"Wy?“úkmƒTÃç
ÇDˆ¿1LŽ >ðÕWõXÏC#N:Í
÷¤˜Î'Y´$ï)&ƒ@Ÿ>-!„j%ºŸ:f?Ëå,ÒÖ6iº´XkË(Á)¶Rn¤¥
https://graph.facebook.com/cnninternational/posts?access_token=xxxxx&format=json
{
"data": [
{
"id": "18793419640_246085255559206",
"from": {
"category": "Tv network",
"name": "CNN International",
"id": "18793419640"
},
"message": "If you\u2019re afraid of heights, you might want to avoid stepping into this \u201cvoid\u201d at the top of the French Alps: http://cnn.it/1kzMekv",
"picture": "http://external.ak.fbcdn.net/safe_image.php?d=AQB_ttzD_Vr9LPOB&w=154&h=154&url=http\u00253A\u00252F\u00252Fi2.cdn.turner.com\u00252Fcnn\u00252Fdam\u00252Fassets\u00252F131225115813-void-tease-story-top.jpg",
"link": "http://cnn.it/1kzMekv",
"name": "The eighth wonder of the world? 'Step into The Void'",
"caption": "edition.cnn.com",
"description": "If you're scared of heights, then this is not for you.",
"icon": "http://static.ak.fbcdn.net/rsrc.php/v2/yq/r/SC2ZmEkfI-X.png",
"privacy": {
"value": ""
},
"type": "link",
"status_type": "shared_story",
"created_time": "2014-01-14T15:09:29+0000",
"updated_time": "2014-01-14T15:22:39+0000",
"shares": {
"count": 15
},
"likes": {
"data": [
{
"id": "100000320486234",
"name": "Cris Pereira"
},
{
"id": "1133601526",
"name": "Diego Hernandez"
},
{
"id": "100004287573273",
"name": "Nawa Nazeer"
},
ASKER
<?php
$page_id = 'cnninternational';
$access_token = 'xxxxxxxxxxxxxxxx';
$feed = 'https://graph.facebook.com/'.$page_id.'/posts?access_token='.$access_token.'&format=json';
$headers = array(
"Content-Type: application/x-www-form-urlencoded; charset: UTF-8"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $feed);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$putput = curl_exec($ch);
curl_close($ch);
var_dump($output);
?>
ASKER
curl_setopt( $curl, CURLOPT_ENCODING, 'gzip,deflate' );
ASKER
ASKER
PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.
TRUSTED BY