Login   Register  
PHP Classes
elePHPant
Icontem

File: feed_example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2012-06-05 10:06
Size: 1,520 bytes
 

Contents

Class file image Download
<?php

    
require_once 'lib/class.zend.eps_feed_writer.inc';

/**
* 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'=>'automated@everettsd.org'));
        
$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'=>'http://www.ipassey.com','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'=>'dpassey@everettsd.org'));        
        
$feed->setEntryCategory(array('term'=>'PHP','label'=>'PHP Classes','scheme'=>'http://www.phpclasses.org'));
        
$feed->setEntry();
        
$str $feed->exec();
        
/** Spit it out to the console and/or put it into a file for validation. **/
        
echo $str;
        
file_put_contents('c:\tmp\myfeed.xml',$str);
?>