summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-12-24 14:13:03 +0400
committerAndrew Dolgov <[email protected]>2012-12-24 14:13:03 +0400
commit4412b877d02c16c033a28fd2b9d9fafa9fd16214 (patch)
tree834c9f541b463f966e97040cae7857b0e07ec8f2 /plugins
parentfa6fbd3659a5f6dd5d2dc20497ec917737210ee9 (diff)
implement HOOK_FEED_PARSED, add example plugin (refs #424)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/example_feed/example_feed.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/example_feed/example_feed.php b/plugins/example_feed/example_feed.php
new file mode 100644
index 000000000..26f392bd7
--- /dev/null
+++ b/plugins/example_feed/example_feed.php
@@ -0,0 +1,22 @@
+<?php
+class Example_Feed extends Plugin {
+
+ // Demonstrates how to query data from the parsed feed object (SimplePie)
+ // don't enable unless debugging feed through f D hotkey or manually.
+
+ private $link;
+ private $host;
+
+ function __construct($host) {
+ $this->link = $host->get_link();
+ $this->host = $host;
+
+ $host->add_hook($host::HOOK_FEED_PARSED, $this);
+ }
+
+ function hook_feed_parsed($feed) {
+ _debug("I'm a little feed short and stout, here's my title: " . $feed->get_title());
+ _debug("... here's my link element: " . $feed->get_link());
+ }
+}
+?>