echo $_GET['hub_challenge']; } else { if ($method == 'POST') { $inputJSON = file_get_contents('php://input'); $input = json_decode($inputJSON, true); foreach ($input['entry'] as $entry) { foreach ($entry['changes'] as $change) { $page_id = $change['value']['page_id']; $conversation_id = $change['value']['thread_id']; $field = $change['field']; if ($field == 'conversations') { $query = new query(); $query->dbname = $config['database_name']; $query->table = 'conversations_botid'; $query->where = array('conversation_id', $conversation_id); $temp = fetchone(SELECT($query)); if ($temp == null) { $html = cURL_HTTP_Request('http://alice.pandorabots.com/', null, false, 'cookie/' . $conversation_id . '.txt')->html; $html = str_replace(array("\t", "\r\n", "\r", "\n"), "", $html); preg_match('/<iframe src="http:\\/\\/sheepridge\\.pandorabots\\.com\\/pandora\\/talk\\?botid=(.+?)&skin=custom_input"/', $html, $match); $botid = $match[1]; $created_time = date("c", 0); } else { $botid = $temp['botid']; $created_time = $temp['created_time']; } $conversations = $fb->get('/' . $conversation_id . '/messages?fields=message,from,created_time', $page_token)->getDecodedBody(); $query = new query(); $query->dbname = $config['database_name']; $query->table = 'conversations_botid'; $query->where = array('conversation_id', $conversation_id);
<meta charset="UTF-8"> </head> <body> <center> <h2>Third-Party Verification</h2> <hr> <a href="/">Home Page</a><br><br> <?php if (!isset($_GET['token'])) { echo 'No given token'; } else { require "function/SQL-function/sql.php"; require "config/config.php"; $query = new query(); $query->dbname = $config['database']['dbname']; $query->table = $config['database']['table']; $query->where = array(array('token', $_GET["token"])); $row = fetchone(SELECT($query)); if ($row) { echo 'ID: ' . $row['fbid'] . '<br>'; echo 'Name: ' . $row['fbname'] . '<br>'; echo 'Time: ' . $row['datetime'] . '<br>'; echo '<a href="//www.facebook.com/' . $row['fbid'] . '">Facebook Profile Page</a>'; } else { echo 'Not found token'; } } ?> </center> </body> </html>