I try using FQL Query to fetch count of share from post on facebook page but I don’t know table who provide this. So my final decision is using CURL to get data.
I’m using CURL and get 2 persons who share that post actually the data is 27 persons. Ajax function on page it’s not reload data again and result keep 2 persons.
If Ajax Function on page works correctly, I can fetch all users who share post.
Another method using FQL Query or Facebook SDK really appreciate..
Could I fetch all users who share post on facebook ?
Thanks in Advance.
$login_email = 'myemail';
$login_pass = 'mypassword';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://login.facebook.com/login.php?m&next=http%3A%2F%2Fm.facebook.com%2Fhome.php');
curl_setopt($ch, CURLOPT_POSTFIELDS,'email='.urlencode($login_email).'&pass='.urlencode($login_pass).'&login=Login');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_COOKIEJAR, "my_cookies.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "my_cookies.txt");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3");
curl_exec($ch);
$url= 'http://www.facebook.com/shares/view?id=390010811012261';
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 300);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1');
curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_REFERER, 'http://www.facebook.com');
curl_setopt($ch, CURLOPT_URL, $url);
$curl_dt= curl_exec($ch);
Scraping Facebook pages like this is a violation of it’s site policies (3.2 of the SRR)
Please file a feature request in the Bug tracker to get the full list of Shares in the API for Post objects (currently we only serve the number of shares, not the full info about them)