-
Notifications
You must be signed in to change notification settings - Fork 0
/
fbpost.php
30 lines (30 loc) · 1.2 KB
/
fbpost.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
include_once 'fbinit.php';
//fbDefaultTokens();
//postToFB($_SESSION['fb_uid'],$_SESSION['fb_access_token']);
function postToFB($id,$token)
{
global $fb;
try {
// Returns a `FacebookFacebookResponse` object
$response = $fb->post(
'/' . $id . '/feed',
array(
'message' => 'Hello Friends :)
I have recently donated to Udgam NGO. It is a developing NGO that helps the poor children become independent by providing necessary education. I highly recommend you to aid them in this good work.
https://facebook.com/1774494506184449'
),
$token
);
$graphNode = $response->getGraphNode();
print_r($graphNode);
} catch (FacebookExceptionsFacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch (FacebookExceptionsFacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
}
//EAAH09htiIfABAGiLaQ6rRGADZBQUs2xH5TRar2XnddnCt3aLswNwUebi5fWZAuPYGUJxytIZBX39Fapuw6Td8ZCjnfgqkQ0y1DUwlw2n7nLyQ9dbxgplQgSArN2HFkdEbUajllaBYi9P9MR0cZBlHRTjO6t2s8eU1VWZC7LtdMPues2g4n4P6b
?>