PHP Classes
elePHPant
Icontem

File: gFeed.test2.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Cesar D. Rodas  >  gFeed  >  gFeed.test2.php  >  Download  
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
Author: By
Last change: * Making visible without user login
Date: 8 years ago
Size: 904 bytes
 

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($f, 1) ) {
   
/*

     * 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);
?>