init.php 636 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. class Example_Feed extends Plugin {
  3. // Demonstrates how to query data from the parsed feed object (SimplePie)
  4. // don't enable unless debugging feed through f D hotkey or manually.
  5. private $host;
  6. function about() {
  7. return array(1.0,
  8. "Example feed plugin",
  9. "fox",
  10. true);
  11. }
  12. function init($host) {
  13. $this->host = $host;
  14. $host->add_hook($host::HOOK_FEED_PARSED, $this);
  15. }
  16. function hook_feed_parsed($feed) {
  17. _debug("I'm a little feed short and stout, here's my title: " . $feed->get_title());
  18. _debug("... here's my link element: " . $feed->get_link());
  19. }
  20. function api_version() {
  21. return 2;
  22. }
  23. }
  24. ?>