example_feed.php 644 B

1234567891011121314151617181920212223242526272829
  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 $link;
  6. private $host;
  7. function about() {
  8. return array(1.0,
  9. "Example feed plugin",
  10. "fox",
  11. true);
  12. }
  13. function init($host) {
  14. $this->link = $host->get_link();
  15. $this->host = $host;
  16. $host->add_hook($host::HOOK_FEED_PARSED, $this);
  17. }
  18. function hook_feed_parsed($feed) {
  19. _debug("I'm a little feed short and stout, here's my title: " . $feed->get_title());
  20. _debug("... here's my link element: " . $feed->get_link());
  21. }
  22. }
  23. ?>