DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   RSS, Web Services and SOAP (http://www.daniweb.com/forums/forum151.html)
-   -   How exactly do you implement your RSS to your own site? (http://www.daniweb.com/forums/thread35821.html)

Kwak Nov 24th, 2005 1:27 am
How exactly do you implement your RSS to your own site?
 
Hello there,

After a search on google, I still could not find the answer to this simple question.


How do you add your blog rss to your own frontpage? The site is all .php.
I have no clue on how to make your rss entries show up on the frontpage inside a table.

Little guidance? Thanks in advance.

cscgal Nov 24th, 2005 1:32 am
Re: How exactly do you implement your RSS to your own site?
 
Let me make sure I understand your question corectly. You have an RSS feed and you want to syndicate this feed on your PHP-driven site?

What you will need is a PHP-based RSS parser. A relaly good, and really powerful one, that I love is called MagpieRSS - http://magpierss.sourceforge.net

It has lots of options but don't let that overwhelm you. Read the FAQ and you will see that it only takes a couple of lines and for you to upload the magpierss folder.

Here is a very basic example:

[php]
require_once('magpierss/rss_fetch.inc');
$url = "path/to/rss/feed.rss";
$rss = fetch_rss($url);
echo "<ul>";
foreach ($rss->items AS $item)
{
$title = $item['title'];
$link = $item['link'];
echo "<li><a href=\"$link\">$title</a></li>";
}
echo "</ul>";
?>
[/php]


All times are GMT -4. The time now is 11:47 pm.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC