업데이트 읽을페이스 북 API 실시간 업데이트 버전 2.2가 내가 작업과 sottoiscrizione했다 PHP 에서 일하는
페이스 북의 API는 v.2.2
하지만 지금 문제 어떻게 읽을 할 수있다 내가 얻은 피드의 업데이트?
코드는 다음과 같습니다 위의 파일 "$ 업데이트"에서
<?php
//file of program
require_once('LoginFb.php');
require_once('FbClass.php');
require_once('dbClass.php');
require_once('FacebookClass.php');
//receive a Real Time Update
$method = $_SERVER['REQUEST_METHOD'];
// In PHP, dots and spaces in query parameter names are converted to
// underscores automatically. So we need to check "hub_mode" instead
// of "hub.mode".
if ($method == 'GET' && $_GET['hub_mode'] == 'subscribe' &&
$_GET['hub_verify_token'] == 'thisisaverifystring') {
echo $_GET['hub_challenge']; //print the code on the page that Facebook expects to read for confirmation
} else if ($method == 'POST') {
$updates = json_decode(file_get_contents("php://input"), true);
// Replace with your own code here to handle the update
// Note the request must complete within 15 seconds.
// Otherwise Facebook server will consider it a timeout and
// resend the push notification again.
$testo=json_decode($updates["entry"]);
$var=fopen("nome_file.txt","a+");
fwrite($var, "ciao");
fwrite($var, $updates);
fclose($var);
error_log('updates = ' . print_r($updates, true));
}
?>
업데이트 된 피드를 포함하고 있지만, 압축을 해제하는 방법?
참고 : 가입 WORKS 및 업데이트가 내 서버에 도착했습니다. 내가 페이스 북의 문서 [link]에 따르면
덕분에 죄를 : - :
기능 없음>는 respose 올바른 코드가 배열의 배열을 포함 그것을 허용하지 ... 괜찮아 내가/나/피드를 요청하고 첫 번째 게시물을 확인합니다 :) – Bonni
Edhiv ... JSON의 ID를 추출하는 이유는 무엇입니까? ... 나는 사용자 ID를 추출하는 문제가있다 – Bonni
나는 내 대답을 업데이트했다. "id"를 "uid"로 변경했습니다. 도움이된다면 대답을 수락하십시오. – abhinav