pubsubhubbub/publisher

pubsubhubbub的发布者实现。

dev-master 2021-12-07 05:38 UTC

This package is auto-updated.

Last update: 2024-09-07 11:32:04 UTC


README

这个用于PubSubHubbub的PHP库是由Josh Fraser编写的,并按照Apache 2.0许可证发布

安装

更新你的composer require块

"require": { "pubsubhubbub/publisher": "*" }

用法

use pubsubhubbub\publisher\Publisher;

// specify which hub you want to use. In this case we'll use the demo hub on app engine.
$hub_url = "http://pubsubhubbub.appspot.com/";

// create a new pubsubhubbub publisher
$p = new Publisher($hub_url);

// specify the feed that has been updated
$topic_url = "http://www.onlineaspect.com";

// notify the hub that the specified topic_url (ATOM feed) has been updated
// alternatively, publish_update() also accepts an array of topic urls
if ($p->publish_update($topic_url)) {
    echo "$topic_url was successfully published to $hub_url";
} else {
    echo "Ooops...";
    print_r($p->last_response());
}