]> git.wh0rd.org - tt-rss.git/blame - plugins/example_feed/example_feed.php
experimental support for per-user plugins (bump schema)
[tt-rss.git] / plugins / example_feed / example_feed.php
CommitLineData
4412b877
AD
1<?php
2class 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
7a866114
AD
10 function _about() {
11 return array(1.0,
12 "Example feed plugin",
de612e7a
AD
13 "fox",
14 true);
7a866114
AD
15 }
16
4412b877
AD
17 function __construct($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?>