Hello friends, this code/snippet is nothing special, just a simple rss reader class written in PHP.
Many times in my projects I use this script to get an RSS feed from some website and now i decided to share with you.
This script can be useful for your projects or your education.
If you have any suggest or better solution you can share or you can correct me. :)
Here an example "How to use this script":
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> PHP Library - RssAgent, RSS Reader </title>
<style type="text/css">
body{font-family: Arial, Helvetica, sans-serif; font-size: 14px; width: 980px; margin: 0 auto; padding-top: 30px; background-color: #EEEEEE;}
._link { font-size: 16px; }
.pDate { color: #888888; }
.giud_link { text-decoration: none; color: #00AA00; font-size: 12px; }
.content { background-color: #FFFFFF; padding: 25px; border: 1px #BBBBBB solid; }
</style>
</head>
<body>
<div class="content">
<?php
include("RssAgent.php");
$RSS = new RssAgent( "http://www.daniweb.com/external.php?type=RSS2" );
for( $i = 0; $i < sizeof($RSS->title); $i++ )
{
echo '<a class="_link" href="' . $RSS->link[$i] . '" target="_blank">' . $RSS->title[$i] . '</a> - ';
echo '<span class="pDate">' . $RSS->pubDate[$i] . '</span> <br />';
echo $RSS->description[$i] . "<br />";
echo '<i> Category: ' . $RSS->category[$i] . "</i> <br />";
echo '<a class="giud_link" href="' . $RSS->guid[$i] . '" target="_blank">' . $RSS->guid[$i] . "</a> <br />";
echo "<br />";
}
?>
</div>
</body>
</html>