4 * RSS feed for user favorites action class.
10 * @author Evan Prodromou <evan@controlyourself.ca>
11 * @author Robin Millette <millette@controlyourself.ca>
12 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
13 * @link http://laconi.ca/
15 * Laconica - a distributed open-source microblogging tool
16 * Copyright (C) 2008, Controlez-Vous, Inc.
18 * This program is free software: you can redistribute it and/or modify
19 * it under the terms of the GNU Affero General Public License as published by
20 * the Free Software Foundation, either version 3 of the License, or
21 * (at your option) any later version.
23 * This program is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU Affero General Public License for more details.
28 * You should have received a copy of the GNU Affero General Public License
29 * along with this program. If not, see <http://www.gnu.org/licenses/>.
32 if (!defined('LACONICA')) {
36 require_once INSTALLDIR.'/lib/rssaction.php';
39 * RSS feed for user favorites action class.
41 * Formatting of RSS handled by Rss10Action
45 * @author Evan Prodromou <evan@controlyourself.ca>
46 * @author Robin Millette <millette@controlyourself.ca>
47 * @author Zach Copley <zach@controlyourself.ca>
48 * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
49 * @link http://laconi.ca/
51 class FavoritesrssAction extends Rss10Action
54 /** The user whose favorites to display */
59 * Find the user to display by supplied nickname
61 * @param array $args Arguments from $_REQUEST
63 * @return boolean success
66 function prepare($args)
68 parent::prepare($args);
70 $nickname = $this->trimmed('nickname');
71 $this->user = User::staticGet('nickname', $nickname);
74 $this->clientError(_('No such user.'));
84 * @param integer $limit max number of notices to return
86 * @return array notices
88 function getNotices($limit=0)
91 $notice = $user->favoriteNotices(0, $limit);
93 while ($notice->fetch()) {
94 $notices[] = clone($notice);
102 * @return array associative array on channel information
104 function getChannel()
107 $c = array('url' => common_local_url('favoritesrss',
110 'title' => sprintf(_("%s's favorite notices"), $user->nickname),
111 'link' => common_local_url('showfavorites',
114 'description' => sprintf(_('Feed of favorite notices of %s'),