init.php 593 B

123456789101112131415161718192021222324252627
  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. }
  21. ?>