summaryrefslogtreecommitdiff
path: root/lib/twitterapi.php
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-07-21 18:01:22 -0400
committerCraig Andrews <candrews@integralblue.com>2009-07-21 18:01:22 -0400
commit38d70f13865b197e17773ba24d67ea1148c32ab3 (patch)
treecc2025f52580f37a11acf7b4095e2cab1cf301fa /lib/twitterapi.php
parent0adaaa1b9de61eaa8f7e4c622cda27fb634b53a5 (diff)
Add <category> to RSS 2.0, use the same tag finding method for RSS 1.0 as for Atom and RSS 2.0.
http://laconi.ca/trac/ticket/864
Diffstat (limited to 'lib/twitterapi.php')
-rw-r--r--lib/twitterapi.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/twitterapi.php b/lib/twitterapi.php
index 79da82a19..b2602e77c 100644
--- a/lib/twitterapi.php
+++ b/lib/twitterapi.php
@@ -265,6 +265,18 @@ class TwitterapiAction extends Action
}
}
*/
+
+ // Tags/Categories
+ $tag = new Notice_tag();
+ $tag->notice_id = $notice->id;
+ if ($tag->find()) {
+ $entry['tags']=array();
+ while ($tag->fetch()) {
+ $entry['tags'][]=$tag->tag;
+ }
+ }
+ $tag->free();
+
// RSS Item specific
$entry['description'] = $entry['content'];
$entry['pubDate'] = common_date_rfc2822($notice->created);
@@ -442,6 +454,12 @@ class TwitterapiAction extends Action
$enclosure = $entry['enclosures'][0];
$this->element('enclosure', array('url'=>$enclosure['url'],'type'=>$enclosure['mimetype'],'length'=>$enclosure['size']), null);
}
+
+ if($entry['tags']){
+ foreach($entry['tags'] as $tag){
+ $this->element('category', null,$tag);
+ }
+ }
$this->elementEnd('item');
}