diff options
author | Zach Copley <zach@status.net> | 2010-02-11 13:54:40 -0800 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-02-11 13:56:05 -0800 |
commit | c465f675d9dbcf9f808bc31a1d01e753df4ddf58 (patch) | |
tree | cccfd152bf1d52f27cd63d00c0337c1273991a11 /actions/apitimelinepublic.php | |
parent | c8d5c8442fe6ce54f7f65d1d0eb4203b06c09583 (diff) |
Make Atom timelines in the API use Atom10feed
Diffstat (limited to 'actions/apitimelinepublic.php')
-rw-r--r-- | actions/apitimelinepublic.php | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/actions/apitimelinepublic.php b/actions/apitimelinepublic.php index 0fb0788e9..c1fa72a3e 100644 --- a/actions/apitimelinepublic.php +++ b/actions/apitimelinepublic.php @@ -74,7 +74,7 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction parent::prepare($args); $this->notices = $this->getNotices(); - + if ($this->since) { throw new ServerException("since parameter is disabled for performance; use since_id", 403); } @@ -122,11 +122,28 @@ class ApiTimelinePublicAction extends ApiPrivateAuthAction $this->showRssTimeline($this->notices, $title, $link, $subtitle, null, $sitelogo); break; case 'atom': - $selfuri = common_root_url() . 'api/statuses/public_timeline.atom'; - $this->showAtomTimeline( - $this->notices, $title, $id, $link, - $subtitle, null, $selfuri, $sitelogo + + $atom = new AtomNoticeFeed(); + + $atom->setId($id); + $atom->setTitle($title); + $atom->setSubtitle($subtitle); + $atom->setLogo($sitelogo); + $atom->setUpdated('now'); + + $atom->addLink(common_local_url('public')); + + $atom->addLink( + $this->getSelfUri( + 'ApiTimelinePublic', array('format' => 'atom') + ), + array('rel' => 'self', 'type' => 'application/atom+xml') ); + + $atom->addEntryFromNotices($this->notices); + + $this->raw($atom->getString()); + break; case 'json': $this->showJsonTimeline($this->notices); |