Pause flash with actionscript Remove firefox klick outline
Jul 07

i recently (yesterday) created a pure rss page. It is made to display several rss flows on one page. Here is the page (it is on the seo topic, and covers the best seo-blogs in the world imo).

So how did i make this page?
First you need a rss parser, witch is a script that reads the rss xml formated text and outputs it to a workable format.

I chose to download and use the magpie rss parser..

After downloading it i put all the files on my webserver in a catalog (seo-nyheter, in this case).

I then created a folder called "cashe" in that folder and chmod it to 777.

After this i created 2 more files, one "index.php", and one "common.php" (for the php "common" scripts).

Index.php has only 2 vital elements to it really the first is this code:

 
<?
	include('common.php');
?>
 

that is used to incude the script.

the other is the line of code to make some rss feeds:

 
<?rss('http://www.any-rss-site',3)?>
 

The http text before the comma is the link to any page that "is" a rss flow. the "3" is the amouts of posts o print out.

the rest of the "index.php" page is common html, as usual.

then in the "common.php" file, i have this php code, and nothing else:

 
 
<?
/*
wrapper, for rss feed, prints in
<ul>
*/
function rss($url, $amount){
	require_once 'magpierss/rss_fetch.inc';
				$rss = fetch_rss($url);
				//echo "Site: ", $rss->channel['title'], "<br>";
				?>
<ul><?
				$i=0;
				foreach ($rss->items as $item ) {
					if ($i<$amount){
						$status = (1 & $i) ? 'odd' : 'even';
						$title = utf8_encode($item[title]);
						$url   = utf8_encode($item[link]);
						echo "
<li><a class=\"$status\" title=\"$title\" target=\"_blank\" rel=\"nofollow\" href=$url>$title</a></li>
 
					";
					}
				$i++;
				}
				?></ul>
 
<?
}
?>
 

and that is all there is to it!

---

update.

If you want more of the rss file to be printed. Look into it and add another row right after this

$title = utf8_encode($item[title]);

For instance if you want the body of the post, and it is called "body" just add

$body = utf8_encode($item[body]);

. And then change the echo statement to something like this

echo "
<li><a class=\"$status\" title=\"$title\" target=\"_blank\" rel=\"nofollow\" href=$url>$title</a>
 
$body
</li>

One Response to “Rss on your website, the simple way”

  1. ardelle Says:

    For me as a consumer all these rewards are very confusing. Everytime I look at a credit card deal I feel that there is some kind of a catch but I am not sure what it is. I feel more confident applying for a credit card online from websites that give you a list of different cards so I can compare every point. Lately I’ve been using

    balance transfers low credit scores

Leave a Reply