]> git.wh0rd.org - tt-rss.git/blob - plugins/example_api/init.php
remove $link
[tt-rss.git] / plugins / example_api / init.php
1 <?php
2 class Example_Api extends Plugin {
3
4 // Demonstrates adding a method to the API
5 // Plugin methods return an array containint
6 // 1. status (STATUS_OK or STATUS_ERR)
7 // 2. arbitrary payload
8
9 private $host;
10
11 function about() {
12 return array(1.0,
13 "Example plugin adding an API method",
14 "fox",
15 true,
16 "http://tt-rss.org/");
17 }
18
19 function init($host) {
20 $this->host = $host;
21
22 $host->add_api_method("example_testmethod", $this);
23 }
24
25 function example_testmethod() {
26 return array(API::STATUS_OK, array("current_time" => time()));
27 }
28 }
29 ?>