+ $feeds = array_unique($feeds);
+
+ ob_start();
+ $ok = $publisher->publish_update($feeds);
+ $push_last_response = ob_get_clean();
+
+ if (!$ok) {
+ common_log(LOG_WARNING,
+ 'Failure publishing ' . count($feeds) . ' feeds to hub at '.
+ $this->hub.': '.$push_last_response);
+ } else {
+ common_log(LOG_INFO,
+ 'Published ' . count($feeds) . ' feeds to hub at '.
+ $this->hub.': '.$push_last_response);
+ }
+
+ return true;
+ }
+
+ /**
+ * Provide version information
+ *
+ * Adds this plugin's version data to the global
+ * version array, for e.g. displaying on the version page.
+ *
+ * @param array &$versions array of array of versions
+ *
+ * @return boolean hook value
+ */
+
+ function onPluginVersion(&$versions)
+ {
+ $about = _m('The PubSubHubBub plugin pushes RSS/Atom updates '.
+ 'to a <a href = "'.
+ 'http://pubsubhubbub.googlecode.com/'.
+ '">PubSubHubBub</a> hub.');
+ if (!$this->enabled()) {
+ $about = '<span class="disabled" style="color:gray">' . $about . '</span> ' .
+ _m('(inactive on private site)');
+ }
+ $versions[] = array('name' => 'PubSubHubBub',
+ 'version' => STATUSNET_VERSION,
+ 'author' => 'Craig Andrews',
+ 'homepage' =>
+ 'http://status.net/wiki/Plugin:PubSubHubBub',
+ 'rawdescription' =>
+ $about);
+
+ return true;