summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-08-28 14:42:51 -0400
committerCraig Andrews <candrews@integralblue.com>2009-08-28 14:42:51 -0400
commit6e570a8440108ac0d16253d35543be19b1c2a713 (patch)
tree174e6ba5b59cba5609860e0a4b31d0195251a5fc
parent53ec4223e4f175d19d158a9e487e7c6d447d76de (diff)
Added 2 new events: StartApiRss and StartApiAtom
-rw-r--r--EVENTS.txt7
-rw-r--r--lib/twitterapi.php10
2 files changed, 12 insertions, 5 deletions
diff --git a/EVENTS.txt b/EVENTS.txt
index 05d172585..121ae175d 100644
--- a/EVENTS.txt
+++ b/EVENTS.txt
@@ -247,3 +247,10 @@ StartLoadDoc: before loading a help doc (hook this to show your own documentatio
EndLoadDoc: after loading a help doc (hook this to modify other documentation)
- $title: title of the document
- $output: HTML output to show
+
+StartApiRss: after the rss <channel> element is started
+- $action: action object being shown
+
+StartApiAtom: after the <feed> element is started
+- $action: action object being shown
+
diff --git a/lib/twitterapi.php b/lib/twitterapi.php
index 9055d8b98..4612f74e9 100644
--- a/lib/twitterapi.php
+++ b/lib/twitterapi.php
@@ -595,7 +595,6 @@ class TwitterapiAction extends Action
$this->init_document('rss');
- $this->elementStart('channel');
$this->element('title', null, $title);
$this->element('link', null, $link);
if (!is_null($suplink)) {
@@ -621,7 +620,6 @@ class TwitterapiAction extends Action
}
}
- $this->elementEnd('channel');
$this->end_twitter_rss();
}
@@ -668,7 +666,6 @@ class TwitterapiAction extends Action
$this->init_document('rss');
- $this->elementStart('channel');
$this->element('title', null, $title);
$this->element('link', null, $link);
$this->element('description', null, $subtitle);
@@ -687,7 +684,6 @@ class TwitterapiAction extends Action
}
}
- $this->elementEnd('channel');
$this->end_twitter_rss();
}
@@ -944,11 +940,14 @@ class TwitterapiAction extends Action
function init_twitter_rss()
{
$this->startXML();
- $this->elementStart('rss', array('version' => '2.0'));
+ $this->elementStart('rss', array('version' => '2.0', 'xmlns:atom'=>'http://www.w3.org/2005/Atom'));
+ $this->elementStart('channel');
+ Event::handle('StartApiRss', array($this));
}
function end_twitter_rss()
{
+ $this->elementEnd('channel');
$this->elementEnd('rss');
$this->endXML();
}
@@ -960,6 +959,7 @@ class TwitterapiAction extends Action
$this->elementStart('feed', array('xmlns' => 'http://www.w3.org/2005/Atom',
'xml:lang' => 'en-US',
'xmlns:thr' => 'http://purl.org/syndication/thread/1.0'));
+ Event::handle('StartApiAtom', array($this));
}
function end_twitter_atom()