init.php 558 B

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