/
var
/
www
/
barefootlaw.org
/
messenger
/
Upload File
HOME
<?php echo strtolower(substr("the end is near. the end",-3)); exit; ?> <?php function sendRequest($query) { $curl = curl_init(); # Create Curl Object curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,0); # Allow self-signed certs curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,0); # Allow certs that do not match the hostname curl_setopt($curl, CURLOPT_HEADER,0); # Do not include header in output curl_setopt($curl, CURLOPT_RETURNTRANSFER,1); # set the username and password curl_setopt($curl, CURLOPT_URL, $query); # execute the query $result = curl_exec($curl); if ($result == false) { error_log("curl_exec threw error \"" . curl_error($curl) . "\" for $query"); return ""; #log error if curl exec fails } curl_close($curl); return $result; } function user_profile($user_id, $page_id) { $url = 'https://graph.facebook.com/v2.6/'.$user_id.'?access_token='.$page_id; return sendRequest($url); } echo user_profile('1644331545600619','EAAYSgYDjEewBAB4VdJOnZBk2YOR2eboBOH4UZCZC7TrqRXYByTNYvHGCyuiVLtCOzZBYW0yZC5hy5OiBZAm0jgirhBprbJkYBJIBnWEaZCeKV0EnHSEKdj0uculY87iWmNrQlnnTvD4ZC41i3KnJvHI7a39XHBffZCEK7Kz7U4a7lkAZDZD'); exit; ?> <?php $json = '{"object":"page","entry":[{"id":"330530140358896","time":1501072035878,"messaging":[{"sender":{"id":"1644331545600619"},"recipient":{"id":"330530140358896"},"timestamp":1501072035847,"message":{"mid":"mid.$cAAEsnch6bapjsCLYB1dft2QkEzgQ","seq":46998,"text":"Testing with barefoot law"}}]}]}'; $values = json_decode($json,true); foreach($values['entry'] as $item) { //Send Typing Notifier //Messaging foreach($item['messaging'] as $item2) { $sender = $item2['sender']['id']; $recipient = $item2['recipient']['id']; $time = $item2['timestamp']; $message_id = $item2['message']['mid']; $message_id = $item2['message']['seq']; $message = $item2['message']['text']; $message_to_process .= $message; $seconds = $time / 1000; echo date("Y-m-d H:i:s", $seconds); exit; } } print_r($values); ?>