How to check Facebook Application is Alive or Dead?


Hits: 2634  
<?php

include("facebook.php");

$APPLICATION_ID = "";
$APPLICATION_SECRET = "";

$facebook = new Facebook(array(
'appId'  => $APPLICATION_ID,
'secret' => $APPLICATION_SECRET,
'cookie' => true
));

$fql    =   "SELECT api_key FROM application WHERE app_id=" . $APPLICATION_ID;
$param  =   array(
 'method'    => 'fql.query',
 'query'     => $fql,
 'callback'  => ''
);

$fqlResult   =   $facebook->api($param);

if(isset($fqlResult[0]['api_key']) && $fqlResult[0]['api_key']!="")
  echo "This app is Alive!";
else
  echo "This app is Dead!";

?>

Published by

Sandeep Verma

I’m an Entrepreneur. I’m proud to work as Blogger, LAMP Programmer, Linux Admin, Web Consultant, Cloud Manager, Apps Developer, Searcher. Concentrate > Observe > Imagine > Launch