Push notification Flickr API:如何(成功)获取带有特定标签的新照片(私人)的推送通知?
我正在为flickr使用php库。我添加了以下flickr推送订阅功能:Push notification Flickr API:如何(成功)获取带有特定标签的新照片(私人)的推送通知?,push-notification,flickr,websub,phpflickr,Push Notification,Flickr,Websub,Phpflickr,我正在为flickr使用php库。我添加了以下flickr推送订阅功能: 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, 'c
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));
}
之后,您已订阅主题设置为“标记”的推送通知:
使用getsubscription订阅后,我得到如下响应:
[0]=>数组([topic]=>标记[callback]=>
mysite.herokuapp.com/flickr/push-notification.php[pending]=>1
[日期创建]=>1435469765[到期]=>0[验证尝试]=>1)
[stat]=>正常
我的回调url是我网站上的php脚本:
<?php
if (isset($_GET['hub_challenge'])) {
print $_GET['hub_challenge'];
}
else {
$xml=file_get_contents("php://input");
file_put_contents('endpoint.txt',$xml);
}
根据此Flickr,Flickr推送API当前仅支持具有公共可见性的图像:
将来我们可能会放宽其中一些限制,但目前推送基本上是一个已注销的用户只需从各种人的photostreams中获取RSS提要即可获得的
此外,API只能由pro帐户用户使用
现在,这篇博文来自2011年,所以我假设情况有所不同,但Flickr Push API上的文本表明它仍然是实验性的。。。请注意,我还没有测试Flickr推送API
<?php
if (isset($_GET['hub_challenge'])) {
print $_GET['hub_challenge'];
}
else {
$xml=file_get_contents("php://input");
file_put_contents('endpoint.txt',$xml);
}