PHP Classes
Icontem

File: gFeed.test2.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 Cesar D. Rodas  >  gFeed  >  gFeed.test2.php  
File: gFeed.test2.php
Role: Example script
Content type: text/plain
Description: Test: how to open a Remote RSS
Class: gFeed
Stream wrapper to read and write RSS feeds
 

Contents

Class file image Download
<?
include("gFeed.php");
$f fopen("rss://http://www.cesarodas.com/feed/","r");
/* Rewinding && reading the first line, which is the RSS information. */

rewind($f);
fread($f,1);

print 
"<h1>${title}</h1>";
print 
"<b>Link</b>: ${link}<br/>\r\n";
print 
"<b>Description</b>: ${description}<br/>\r\n";
print 
"<b>Generator</b>: ${generator}<br/>\r\n";
print 
"<b>Lenguage</b>: ${language}<br/>\r\n";
print 
"<b>Encoding</b>: ${encoding}<br/>\r\n";

print 
"<br/>\r\n";

print 
"<hr>\r\n";



while ( 
fread($f1) ) {
    
/*

     *    After the first read (information of blog), comes

     *    the RSS entries

     */

    
print "<b>Title</b>: ${title}<br/>\r\n";

    print 
"<b>Link</b>: ${link}<br/>\r\n";

    print 
"<b>Author</b>: ${author}<br/>\r\n";

    print 
"<b>Date</b>: ${date}<br/>\r\n";

    print 
"<b>Description</b>: ${description}<br/>\r\n";

    print 
"<hr>\r\n";

}

fclose($f);
?>

 
  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