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