Location: PHPKode > projects > Pheeder RSS Generator > pheeder_1.0.1/examples/simple.php
<?php

/**
 * Simple Example
 * 
 * This example illustrates, how easy it is to create a simple RSS feed with Pheeder.
 * If you wish to see all the feed and item tags, please take a look
 * at the <b>{@link complete.php Complete Example}</b>.
 * 
 * Please, click the link <b>Source Code for this file</b> below to see the example.
 * 
 * <i>LICENSE:</i>
 * 
 * <i>This library is free software; you can redistribute it
 * and/or modify it under the terms of the GNU Lesser General
 * Public License as published by the Free Software Foundation;
 * either version 2.1 of the License, or (at your option) any
 * later version.</i>
 * 
 * <i>This library 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
 * Lesser General Public License for more details.</i>
 * 
 * <i>You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</i>
 *
 * @author      Jure Merhar <hide@address.com>
 * @copyright   Copyright (c) 2008, Jure Merhar
 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
 * @package     Pheeder
 * @subpackage  Examples
 * @filesource
 * @link        http://pheeder.sourceforge.net/
 * @version     $Id: simple.php 3 2008-03-18 10:06:37Z jmerhar $
 */

/**
 * Include the Pheeder bootstrap file
 */
require '../lib/pheeder.php';

/**
 * RSS Feed items
 * 
 * In a real-world application, you would retrieve the items from a database or a file.
 */
$items = array(
  array(
    'title'       => 'First RSS Entry',
    'link'        => 'http://www.example.org/first',
    'description' => 'This is the first entry in this RSS feed',
    'pubDate'     => '2008-03-16 15:03:15',
    'guid'        => 'http://www.example.org/first'
  ),
  array(
    'title'       => 'Second RSS Entry',
    'link'        => 'http://www.example.org/second',
    'description' => 'This is the second entry in this RSS feed',
    'pubDate'     => '2008-03-16 19:53:41',
    'guid'        => 'http://www.example.org/second'
  )
);

$feed = new RssFeed();
$feed['title']       = 'Simple Example Feed';
$feed['description'] = 'A simple RSS feed example';
$feed['pubDate']     = '2008-03-16';
$feed->addItems($items);
$feed->run();
Return current item: Pheeder RSS Generator