publicrss.php 2.56 KB
Newer Older
1
<?php
Robin Millette's avatar
Robin Millette committed
2 3 4 5 6 7
/**
 * Public RSS action class.
 *
 * PHP version 5
 *
 * @category Action
8
 * @package  StatusNet
9 10
 * @author   Evan Prodromou <evan@status.net>
 * @author   Robin Millette <millette@status.net>
Robin Millette's avatar
Robin Millette committed
11
 * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
12
 * @link     http://status.net/
Robin Millette's avatar
Robin Millette committed
13
 *
14
 * StatusNet - the distributed open-source microblogging tool
15
 * Copyright (C) 2008, 2009, StatusNet, Inc.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

mmn's avatar
mmn committed
31
if (!defined('GNUSOCIAL')) { exit(1); }
32

Robin Millette's avatar
Robin Millette committed
33
/**
Robin Millette's avatar
Robin Millette committed
34 35
 * RSS feed for public timeline.
 *
Robin Millette's avatar
Robin Millette committed
36 37 38
 * Formatting of RSS handled by Rss10Action
 *
 * @category Action
39
 * @package  StatusNet
40 41
 * @author   Evan Prodromou <evan@status.net>
 * @author   Robin Millette <millette@status.net>
Robin Millette's avatar
Robin Millette committed
42
 * @license  http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
43
 * @link     http://status.net/
Robin Millette's avatar
Robin Millette committed
44
 */
45 46
class PublicrssAction extends Rss10Action
{
Robin Millette's avatar
Robin Millette committed
47 48 49 50 51 52 53
    /**
     * Get notices
     *
     * @param integer $limit max number of notices to return
     *
     * @return array notices
     */
54
    protected function getNotices()
55
    {
56 57
        $stream  = Notice::publicStream(0, $this->limit);
        return $stream->fetchAll();
58 59
    }

Robin Millette's avatar
Robin Millette committed
60 61 62 63 64 65
     /**
     * Get channel.
     *
     * @return array associative array on channel information
     */
    function getChannel()
66
    {
67
        $sitename = common_config('site', 'name');
Robin Millette's avatar
Robin Millette committed
68
        $c = array(
69 70 71 72 73 74
              'url' => common_local_url('publicrss'),
            // TRANS: Public RSS feed title. %s is the StatusNet site name.
              'title' => sprintf(_('%s public timeline'), $sitename),
              'link' => common_local_url('public'),
            // TRANS: Public RSS feed description. %s is the StatusNet site name.
              'description' => sprintf(_('%s updates from everyone.'), $sitename));
75 76 77
        return $c;
    }

Robin Millette's avatar
Robin Millette committed
78 79 80 81
    /**
     * Get image.
     *
     * @return nothing
82
     */
Robin Millette's avatar
Robin Millette committed
83
    function getImage()
84
    {
Robin Millette's avatar
Robin Millette committed
85
        // nop
86
    }
87

88
    function isReadOnly($args)
89 90 91
    {
        return true;
    }
Robin Millette's avatar
Robin Millette committed
92
}