diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2008-10-26 10:53:26 -0400 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2008-10-26 10:53:26 -0400 |
commit | 90e4512df2c8497cea0ad704d10f464b1856d58b (patch) | |
tree | 7973a48c678a7a2297d549f91b15ffd3b9300fed /lib | |
parent | 6503fd72e174191387eca58327079911bab18daa (diff) |
add SUP links to RSS and Atom, too
darcs-hash:20081026145326-5ed1f-430b98eedef21903caaae47e3355482ae7bfa616.gz
Diffstat (limited to 'lib')
-rw-r--r-- | lib/twitterapi.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/twitterapi.php b/lib/twitterapi.php index 734fc4907..d4b6fff4f 100644 --- a/lib/twitterapi.php +++ b/lib/twitterapi.php @@ -259,13 +259,20 @@ class TwitterapiAction extends Action { $this->end_document('xml'); } - function show_rss_timeline($notice, $title, $link, $subtitle) { + function show_rss_timeline($notice, $title, $link, $subtitle, $suplink=NULL) { $this->init_document('rss'); common_element_start('channel'); common_element('title', NULL, $title); common_element('link', NULL, $link); + if (!is_null($suplink)) { + # For FriendFeed's SUP protocol + common_element('link', array('xmlns' => 'http://www.w3.org/2005/Atom', + 'rel' => 'http://api.friendfeed.com/2008/03#sup', + 'href' => $suplink, + 'type' => 'application/json')); + } common_element('description', NULL, $subtitle); common_element('language', NULL, 'en-us'); common_element('ttl', NULL, '40'); @@ -287,13 +294,19 @@ class TwitterapiAction extends Action { $this->end_twitter_rss(); } - function show_atom_timeline($notice, $title, $id, $link, $subtitle=NULL) { + function show_atom_timeline($notice, $title, $id, $link, $subtitle=NULL, $suplink=NULL) { $this->init_document('atom'); common_element('title', NULL, $title); common_element('id', NULL, $id); common_element('link', array('href' => $link, 'rel' => 'alternate', 'type' => 'text/html'), NULL); + if (!is_null($suplink)) { + # For FriendFeed's SUP protocol + common_element('link', array('rel' => 'http://api.friendfeed.com/2008/03#sup', + 'href' => $suplink, + 'type' => 'application/json')); + } common_element('subtitle', NULL, $subtitle); if (is_array($notice)) { |