<?php
/**
* Complete Example
*
* This example demonstrates the use of all available RSS 2.0 tags. For a more common
* usage, please see the <b>{@link simple.php Simple 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: complete.php 3 2008-03-18 10:06:37Z jmerhar $
*/
/**
* Include the Pheeder bootstrap file
*/
require '../lib/pheeder.php';
/**
* The feed data array
*
* This is the array, from which the feed is generated. It includes all the possible
* RSS 2.0 tags, as well as two feed items.
*/
$data = array(
'title' => 'Complete Example Feed',
'link' => 'http://www.example.org/',
'description' => 'A complete example, demonstrating all RSS 2.0 tags',
'language' => 'en',
'copyright' => 'Copyright © 2008, Jure Merhar',
'managingEditor' => 'hide@address.com (Jure Merhar)',
'webMaster' => 'hide@address.com (Jure Merhar)',
'pubDate' => '2008-03-16',
'lastBuildDate' => '2008-03-16 21:37:26',
'category' => array(
'Example category',
array('domain' => 'http://www.example.org', 'value' => 'Domain category')
),
'generator' => 'Pheeder RSS Generator by Jure Merhar (http://pheeder.sourceforge.net/)',
'docs' => 'http://www.rssboard.org/rss-specification',
'cloud' => array(
'url' => 'http://www.example.org/rpc',
'registerProcedure' => 'pingMe'
),
'ttl' => '60',
'image' => 'valid-rss.png',
'rating' => '(PICS-1.1 "http://www.classify.org/safesurf/" l r (SS~~000 1))',
/* DEPRECATED
'textInput' => array(
'title' => 'Text Input',
'description' => 'A text input tag',
'name' => 'text_input',
'link' => 'http://www.example.org/process'
),
*/
'skipHours' => array(10, 11, 12, 21, 22),
'skipDays' => array('Saturday', 'Sunday'),
'items' => array(
array(
'title' => 'First RSS Entry',
'link' => 'http://www.example.org/first',
'description' => 'This is the first entry in this RSS feed',
'author' => 'hide@address.com (Jure Merhar)',
'category' => array('Example category'),
'comments' => 'http://www.example.org/first/comments',
'enclosure' => 'valid-rss.png',
'guid' => 'http://www.example.org/first',
'pubDate' => '2008-03-16 15:03:15',
'source' => array(
'url' => 'http://www.example.com/first-article',
'value' => 'Example website'
)
),
array(
'title' => 'Second RSS Entry',
'link' => 'http://www.example.org/second',
'description' => 'This is the second entry in this RSS feed',
'author' => 'hide@address.com (Jure Merhar)',
'category' => array(
array('domain' => 'http://www.example.org', 'value' => 'Domain category')
),
'comments' => 'http://www.example.org/second/comments',
'enclosure' => array(
'url' => 'http://www.example.org/second-podcast.mp3',
'length' => '12216320',
'type' => 'audio/mpeg'
),
'guid' => 'http://www.example.org/second',
'pubDate' => '2008-03-16 19:53:41',
'source' => array(
'url' => 'http://www.example.com/second-article',
'value' => 'Example website'
)
)
)
);
$feed = new RssFeed($data);
$feed->enableImageSize();
$feed->setEncoding('utf-8');
$feed->setVersion('2.0');
$feed->setAtomLink('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
$feed->run();