SimplePie : an alternative to MagpieRSS

“Time is money”. Everybody know that. So I like to present you SimplePie, an alternative to MagpieRSS. SimplePie is very easy and simple to use as its name.

simplePie
.

  1. First of all download the latest version of SimplePie
  2. Then connect to your ftp
  3. Once this step done, create two folders : php and cache. Check that these folders have at least a CHMOD of 705
  4. Decompress the zip file you have downloaded an upload the file “simplepie.inc” on the folder “php” and the folder “SimplePie 1.1.1” at the root of your website. SimplePie is finally functional. You can use it with default settings or customize it. To do this you can use the example below.
  5. To know the non-exhaustive list of the different functions of SimplePie go to this page:
    http://simplepie.org/wiki/reference/start
  6. And now you know more about SimplePie.

 < ?php<br />
/* Check that the file SimplePie is at the root of your website.<br />
   You can replace "php/simplepie.inc"  by something else.  This one must be accessible <br />
*/<br /><br /><br />
require_once('php/simplepie.inc');</p><br /><br />
<p>// L'adresse du flux rss à parser.<br /><br /><br />
$feed = new SimplePie('http://www.nopokographics.com/English/?feed=rss2');</p><br /><br />
<p>// This is the assurance that the content delivered to the browser is formatted text / html and that the encoding is UTF-8.<br /><br /><br />
$feed->handle_content_type();<br /><br /><br />
?><br /><br /><br />
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"<br />
		"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"></p><br />
<p><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><br />
<head><br /><br /><br />
	<title>My first rss feed page</title><br />
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" /><br />
</head><br />
<body><br />
	<div><br />
		< !—Your blog  or your website title which feeds you need to show. Exemple: www.cnn.com --><br />
		<h1><a href="<?php echo $feed->get_permalink(); ?>">< ?php echo $feed->get_title(); ?></a></h1></div></body></html></p><br />
<p>		< !—Blog  description. --><br />
		</p><p>< ?php echo $feed->get_description(); ?></p><br />
	< ?php<br />
	/*<br />
	RSS feed parse. The variable $item is the common title. <br />
	*/<br /><br /><br />
	foreach ($feed->get_items() as $item):<br />
	?><br /><br />
<p>		<div><br /><br /><br />
			< !—The title of feed which is read --><br /><br /><br />
			<h2><a href="<?php echo $item->get_permalink(); ?>">< ?php echo $item->get_title(); ?></a></h2></div></p><br />
<p>			< !—His description --><br />
			</p><p>< ?php echo $item->get_description(); ?></p><br />
<p>			< !—His publish date --><br />
			</p><p><small>Posted on < ?php echo $item->get_date('j F Y | g:i a'); ?></small></p><br />
		<br /><br /><br />
	< ?php endforeach; ?><br />
<br /><br /><br />
 

Post external references

  1. reference #1
    http://simplepie.org/downloads/?download
  2. reference #2
    http://simplepie.org/wiki/reference/start

  • Unique Post

  1. Chris Canning — 11.02.09,  23:56

    Fantastic! Thanks for this!
    I’m trying to get the simplepie filter add-on to work with it but no success. Have you added it to yours? Which folder did you put it in? this is a very handsome site btw.

  2. yelloface — 14.02.09,  10:47

    Not in this blog but in an old one.

  3. Chris Canning — 01.03.09,  19:08

    You are right, simplepie is very easy to use. The video tutorial is great and your directions were the missing piece of it! I still haven’t got the filter add-on working, though. When you used it in your old blog, did you create a form for the filter terms? How did you specify the urls? Does auto-detect still apply? If I type in cnn.com, or any other simple url, nothing gets returned? thank you very much for any insights you can provide me with. Again, this is a beautiful site.

  4. cyworcertiore — 11.11.09,  0:54

    I found this site using google.com And i want to thank you for your work. You have done really very good site. Great work, great site! Thank you!

    Sorry for offtopic

  5. cyworcertiore — 13.11.09,  6:14

    I found this site using [url=http://google.com]google.com[/url] And i want to thank you for your work. You have done really very good site. Great work, great site! Thank you!

    Sorry for offtopic

  6. Sisir — 06.05.11,  11:18

    Hi, I am trying to show the blog title from where the item is showing. How can i do this? Send me a email if you reply this. Thanks!

Leave a comment