PHP Classes

File: feed_example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of David Passey  >  Zend EPS Feed Writer  >  feed_example.php  >  Download  
File: feed_example.php
Role: Example script
Content type: text/plain
Description: Feed writer example script
Class: Zend EPS Feed Writer
Generate XML for RSS 2.0 or Atom feeds
Author: By
Last change:
Date: 3 years ago
Size: 1,520 bytes


Class file image Download

require_once 'lib/';

* Feed example.
* Atom and RSS are almost identical except for a few minor differences.
* ZF will tell you if something is wrong during the export phase.
* A feed validator service will also point out any problems.
* Review the documentation for all functionality.
$feed = new Zend_EPS_Feed_Writer('Everett Public Schools','http://vector/feeds/tr.xml');
$feed->setFeedAuthor(array('name'=>'Otto Mated, IST Operations','email'=>''));
$feed->setFeedCopyright(sprintf("%d, %s",date("Y"),'Everett Public Schools'));
$feed->setFeedDescription('Import Log Feed Example');
$feed->setFeedLogo(array('uri'=>'http://plondar/images/folder_open.gif','link'=>'','title'=>'a logo','description'=>'my logo description'));
$feed->getEntry('The first entry','http://vector/feeds/xml/9x7odzf62b.xml');
$feed->setEntryDescription('The is the short description of this entry.');
$feed->setEntryContent('This is the long description of the entry. Both descriptions can also contain some HTML.');
$feed->setEntryAuthor(array('name'=>'David Passey','email'=>''));
$feed->setEntryCategory(array('term'=>'PHP','label'=>'PHP Classes','scheme'=>''));
$str = $feed->exec();
/** Spit it out to the console and/or put it into a file for validation. **/
echo $str;