From 735b8ddc676cc7d85ca4256994755e61ea6023a1 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 22 May 2008 07:41:52 -0400 Subject: RSS feeds for public stream and friends streams darcs-hash:20080522114152-84dde-7e9b6f465829fc71391613c93df112a7956deffc.gz --- actions/publicrss.php | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 actions/publicrss.php (limited to 'actions/publicrss.php') diff --git a/actions/publicrss.php b/actions/publicrss.php new file mode 100644 index 000000000..0cf572dbe --- /dev/null +++ b/actions/publicrss.php @@ -0,0 +1,65 @@ +. + */ + +if (!defined('LACONICA')) { exit(1); } + +require_once(INSTALLDIR.'/lib/rssaction.php'); + +// Formatting of RSS handled by Rss10Action + +class PublicrssAction extends Rss10Action { + + function init() { + return true; + } + + function get_notices($limit=0) { + + $user = $this->user; + $notices = array(); + + $notice = DB_DataObject::factory('notice'); + + $notice->orderBy('created DESC'); + + if ($limit != 0) { + $notice->limit(0, $limit); + } + $notice->find(); + + while ($notice->fetch()) { + $notices[] = clone($notice); + } + + return $notices; + } + + function get_channel() { + global $config; + $c = array('url' => common_local_url('publicrss'), + 'title' => $config['site']['name'] . _t(' Public Stream'), + 'link' => common_local_url('public'), + 'description' => _t('All updates for ') . $config['site']['name']); + return $c; + } + + function get_image() { + return NULL; + } +} \ No newline at end of file -- cgit v1.2.3-54-g00ecf