Skip to content

Instantly share code, notes, and snippets.

@rintoug
Last active March 23, 2017 13:04
Show Gist options
  • Save rintoug/1cc6d88c767b77c22848652cb6ef8680 to your computer and use it in GitHub Desktop.
Save rintoug/1cc6d88c767b77c22848652cb6ef8680 to your computer and use it in GitHub Desktop.
Gettting facebook events in php and curl
$access_token = '398021147245479|1e3e221bc154a0fdbbf5372d80a35318';
$graph_url= "https://graph.facebook.com/TheToyStore.ME/events";
$post_datta = "access_token=" .$access_token."&method=get&fields=cover,description,name";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $graph_url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_datta);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$output = curl_exec($ch);
curl_close($ch);
print_r($output);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment