2012-12-24 10:13:03 +00:00
|
|
|
<?php
|
|
|
|
class Example_Feed extends Plugin {
|
|
|
|
|
|
|
|
// Demonstrates how to query data from the parsed feed object (SimplePie)
|
|
|
|
// don't enable unless debugging feed through f D hotkey or manually.
|
|
|
|
|
|
|
|
private $host;
|
|
|
|
|
2012-12-25 06:02:08 +00:00
|
|
|
function about() {
|
2012-12-24 11:39:42 +00:00
|
|
|
return array(1.0,
|
|
|
|
"Example feed plugin",
|
2012-12-24 20:45:10 +00:00
|
|
|
"fox",
|
|
|
|
true);
|
2012-12-24 11:39:42 +00:00
|
|
|
}
|
|
|
|
|
2012-12-25 06:02:08 +00:00
|
|
|
function init($host) {
|
2012-12-24 10:13:03 +00:00
|
|
|
$this->host = $host;
|
|
|
|
|
|
|
|
$host->add_hook($host::HOOK_FEED_PARSED, $this);
|
|
|
|
}
|
|
|
|
|
|
|
|
function hook_feed_parsed($feed) {
|
|
|
|
_debug("I'm a little feed short and stout, here's my title: " . $feed->get_title());
|
|
|
|
_debug("... here's my link element: " . $feed->get_link());
|
|
|
|
}
|
2013-04-19 13:31:56 +00:00
|
|
|
|
|
|
|
function api_version() {
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
2012-12-24 10:13:03 +00:00
|
|
|
}
|
|
|
|
?>
|