我正在使用this php库来进行flickr。我添加了以下flickr push_subscription函数:
function push_subscribe ($topic = NULL, $callback = NULL, $verify = NULL, $verify_token = NULL, $lease_seconds = NULL, $tags = NULL) {
return $this->call('flickr.push.subscribe', array('topic' => $topic, 'callback' => $callback, 'verify' => $verify, 'verify_token' => $verify_token, 'lease_seconds' => $lease_seconds, 'tags' => $tags));
}
之后订阅推送通知,主题设置为"标签":
$res = $f->push_subscribe("tags", "http://mysite.herokuapp.com/flickr/push-notification.php", "async", NULL, NULL, "personal");
使用getsubscription订阅后,我得到了回复:
[0] =>数组([topic] =>标签[callback] => mysite.herokuapp.com/flickr/push-notification.php [pending] => 1 [date_create] => 1435469765 [到期] => 0 [verify_attempts] => 1)
[stat] =>确定
我的回调网址是我网站上的一个php脚本:
<?php
if (isset($_GET['hub_challenge'])) {
print $_GET['hub_challenge'];
}
else {
$xml=file_get_contents("php://input");
file_put_contents('endpoint.txt',$xml);
}
但是,在上传带有特定标签的新照片后,我不得到了什么? endpoint.txt
文件为空。为什么?
我错过了什么?