PHP Classes
Icontem

File: Abs_Xml_Rss/AbsAtomWriter10/example_write_atom_1.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Costin T  >  Abs_Xml_Rss  >  Abs_Xml_Rss/AbsAtomWriter10/example_write_atom_1.php  
File: Abs_Xml_Rss/AbsAtomWriter10/example_write_atom_1.php
Role: Example script
Content type: text/plain
Description: Example writing an ATOM 1.0 feed
Class: Abs_Xml_Rss
Read and write RSS and Atom feeds
 

Contents

Class file image Download
<?php
    
# No cache headers
    
header("Expires: Mon, 05 June 2001 05:06:07 GMT");
      
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
    
header('Cache-Control: pre-check=0, post-check=0, max-age=0');
    
header("Cache-Control: no-cache, must-revalidate");
    
header("Pragma: no-cache");

    include_once 
"class.AbsAtomWriter10.php";


    
$xml = new AbsAtomWriter10();


    
// START DOCUMENT
    
$xml->StartDocument();

    
// ADD NAMESPACES
    
$xml->AddNamespaces(); // could be empty, but the function call is required to close the feed tag !

    // ADD BASE TAGS
    
$xml->AddBaseTags('June Framework Blog''Latest entries on: June Framework Blog',
                          
'http://june-js.com/blog/''self''Mon, 20 Apr 2009 22:00:40''Costin Trifan');


    
// ADD ENTRIES
    
$c1 "Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis
doloribus asperiores repellat"
;
    
$c2 "Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis
doloribus asperiores repellat"
;
    
$xml->AddEntry('AbsTemplate - A simple PHP Template Engine''http://june-js.com/blog/post.php?pid=11''Sun, 12 Apr 2009 02:01:52 GMT'$c1);
    
$xml->AddEntry('XLog - A Log class for PHP''http://june-js.com/blog/post.php?pid=10''Wed, 18 Mar 2009 14:05:29'$c2);


    
// END DOCUMENT
    
$xml->EndDocument();

    
// SAVE THE FEED'S CONTENT INTO AN XML FILE
    
$dir getcwd().DIRECTORY_SEPARATOR.'xml'.DIRECTORY_SEPARATOR;
    
$xml->SaveDocument($dir,'atom_1.xml');

?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products