]>
Commit | Line | Data |
---|---|---|
1 | <?php | |
2 | class Example_Feed extends Plugin { | |
3 | ||
4 | // Demonstrates how to query data from the parsed feed object (SimplePie) | |
5 | // don't enable unless debugging feed through f D hotkey or manually. | |
6 | ||
7 | private $host; | |
8 | ||
9 | function about() { | |
10 | return array(1.0, | |
11 | "Example feed plugin", | |
12 | "fox", | |
13 | true); | |
14 | } | |
15 | ||
16 | function init($host) { | |
17 | $this->host = $host; | |
18 | ||
19 | $host->add_hook($host::HOOK_FEED_PARSED, $this); | |
20 | } | |
21 | ||
22 | function hook_feed_parsed($feed) { | |
23 | _debug("I'm a little feed short and stout, here's my title: " . $feed->get_title()); | |
24 | _debug("... here's my link element: " . $feed->get_link()); | |
25 | } | |
26 | } | |
27 | ?> |