Skip to content

Instantly share code, notes, and snippets.

@phwd
Created April 27, 2013 21:19
Show Gist options
  • Save phwd/5474769 to your computer and use it in GitHub Desktop.
Save phwd/5474769 to your computer and use it in GitHub Desktop.
<?php
define('VERIFY_TOKEN', 'pancakes');
$method = $_SERVER['REQUEST_METHOD'];
if ($method == 'GET' && $_GET['hub_mode'] == 'subscribe' && $_GET['hub_verify_token'] == VERIFY_TOKEN) {
echo $_GET['hub_challenge'];
} else if ($method == 'POST') {
$updates = json_decode(file_get_contents("php://input"), true);
file_put_contents('updates.txt',print_r($updates, true), FILE_APPEND);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment