]> git.wh0rd.org - tt-rss.git/blob - plugins/example_feed/example_feed.php
more work on user-selectable plugins; properly process system and user plugins
[tt-rss.git] / plugins / example_feed / example_feed.php
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
10 function about() {
11 return array(1.0,
12 "Example feed plugin",
13 "fox",
14 true);
15 }
16
17 function init($host) {
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 ?>