]>
Commit | Line | Data |
---|---|---|
4412b877 AD |
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 $link; | |
8 | private $host; | |
9 | ||
d2a421e3 | 10 | function about() { |
7a866114 AD |
11 | return array(1.0, |
12 | "Example feed plugin", | |
de612e7a AD |
13 | "fox", |
14 | true); | |
7a866114 AD |
15 | } |
16 | ||
d2a421e3 | 17 | function init($host) { |
4412b877 AD |
18 | $this->link = $host->get_link(); |
19 | $this->host = $host; | |
20 | ||
21 | $host->add_hook($host::HOOK_FEED_PARSED, $this); | |
22 | } | |
23 | ||
24 | function hook_feed_parsed($feed) { | |
25 | _debug("I'm a little feed short and stout, here's my title: " . $feed->get_title()); | |
26 | _debug("... here's my link element: " . $feed->get_link()); | |
27 | } | |
28 | } | |
29 | ?> |