Last active
October 11, 2015 03:37
-
-
Save Pop-Code/3796914 to your computer and use it in GitHub Desktop.
Get Facebook API in Facebook AWD
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 | |
/** | |
* Helper to access Facebook AWD api object | |
* Return a AWD_facebook_api object that extends the Facebook API. | |
*/ | |
function getFacebookApi(){ | |
global $AWD_facebook; | |
if(is_object($AWD_facebook->fcbk)){ | |
return $AWD_facebook->fcbk; | |
} | |
return false; | |
} |
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 | |
//get the facebook api | |
$facebook = getFacebookApi(); | |
//example usage. | |
if($facebook){ | |
try{ | |
$result = $facebook->api('YOUR_QUERY'); | |
}catch(Exception $e){ | |
$result = false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment