summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-02-10 14:24:16 -0800
committerZach Copley <zach@status.net>2010-02-11 13:56:05 -0800
commitce3c3be1bf971329f82bedbf3aae636e3c8ecbf9 (patch)
treee8072c70df5243c78740e2179b034edcfee2b4ce /actions
parent1773d12a24d2720cdb6c1b517999cac1f708b355 (diff)
Utility classes for atom feeds
Diffstat (limited to 'actions')
-rw-r--r--actions/apitimelineuser.php39
1 files changed, 36 insertions, 3 deletions
diff --git a/actions/apitimelineuser.php b/actions/apitimelineuser.php
index ed9104905..bcc48f59c 100644
--- a/actions/apitimelineuser.php
+++ b/actions/apitimelineuser.php
@@ -145,7 +145,26 @@ class ApiTimelineUserAction extends ApiBareAuthAction
);
break;
case 'atom':
+
+ header('Content-Type: application/atom+xml; charset=utf-8');
+
+ $atom = new AtomNoticeFeed();
+
+ $atom->addLink(
+ common_local_url(
+ 'showstream',
+ array('nickname' => $this->user->nickname)
+ )
+ );
+
+ $atom->setId($id);
+ $atom->setTitle($title);
+ $atom->setSubtitle($subtitle);
+ $atom->setLogo($logo);
+ $atom->setUpdated('now');
+
$id = $this->arg('id');
+
if ($id) {
$selfuri = common_root_url() .
'api/statuses/user_timeline/' .
@@ -154,10 +173,24 @@ class ApiTimelineUserAction extends ApiBareAuthAction
$selfuri = common_root_url() .
'api/statuses/user_timeline.atom';
}
- $this->showAtomTimeline(
- $this->notices, $title, $id, $link,
- $subtitle, $suplink, $selfuri, $logo
+
+ $atom->addLink(
+ $selfuri,
+ array('rel' => 'self', 'type' => 'application/atom+xml')
+ );
+
+ $atom->addLink(
+ $suplink,
+ array(
+ 'rel' => 'http://api.friendfeed.com/2008/03#sup',
+ 'type' => 'application/json'
+ )
);
+
+ $atom->addEntryFromNotices($this->notices);
+
+ print $atom->getString();
+
break;
case 'json':
$this->showJsonTimeline($this->notices);