Instagramがリアルタイムサブスクリプションで空のデータを送ってくるという問題があります。これが私の手順です
サブスクリプションを登録しています
root@132701-10002:/var/www/realtime# curl -F 'client_id=MYSECRET' -F 'client_secret= MYSECRET' -F 'object=tag' -F 'aspect=media' -F 'object_id=newyork' -F 'callback_url=http://myurl/realtime' https://api.instagram.com/v1/subscriptions/
Instagramが私に答えます
{
"meta": {
"code": 200
},
"data": {
"object": "tag",
"object_id": "newyork",
"aspect": "media",
"callback_url": "http://myurl/realtime",
"type": "subscription",
"id": "2838731"
}
}
大丈夫です。
このスクリプトを使用してInstagramのリクエストを受け入れようとしているよりも:
<?php
if (@$_GET["hub_challenge"])
{
echo $_GET["hub_challenge"];
}
$myString = file_get_contents('php://input');
$answer = json_decode($myString);
$ALL = date("F j, Y, g:i a")." ".print_r($answer,true)."\r\n";
file_put_contents('activity.log', $ALL, FILE_APPEND);
?>
アクティビティでは、空のクエリから構成されます。
January 28, 2013, 12:09 pm
January 28, 2013, 12:09 pm
January 28, 2013, 12:09 pm
January 28, 2013, 12:09 pm
January 28, 2013, 12:09 pm
January 28, 2013, 12:09 pm
January 28, 2013, 12:09 pm
January 28, 2013, 12:10 pm
January 28, 2013, 12:10 pm
January 28, 2013, 12:10 pm
January 28, 2013, 12:10 pm
January 28, 2013, 12:10 pm
January 28, 2013, 12:10 pm
January 28, 2013, 12:10 pm