954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to use RSS?

Hi,I want to use RSS at my site.How to do so the contennent can be displayed at my site?This is the code:I want to use RSS at my site,how to do in dreamweaver?
This is the code:


Code:

<?xml version="1.0" encoding="ISO-8859-1" ?>
-
- WeakGame Entertainmentweakgame.com
Sun, 25 Dec 2005 04:15:31 -0500The latest posts on WeakGame.comen-us
- No Santahttp://www.weakgame.com/?show=5594
Sun, 25 Dec 2005 00:00:00 -0500
- The "L" Wordhttp://www.weakgame.com/?show=5593
Sun, 25 Dec 2005 00:00:00 -0500
- Peter Griffin Christmashttp://www.weakgame.com/?show=5592
Sun, 25 Dec 2005 00:00:00 -0500
- Get Rid of Wifeyhttp://www.weakgame.com/?show=5585
A funny McDonalds commercial that shows us how to get rid of the wifeSun, 25 Dec 2005 00:00:00 -0500
- Ref Knock-outhttp://www.weakgame.com/?show=5560
Lucky this wasnt a championship match or else the red would be walking away with a belt around his waist.Sat, 24 Dec 2005 00:00:00 -0500

steven01
Light Poster
32 posts since Apr 2005
Reputation Points: 10
Solved Threads: 0
 

You need an RSS parser. There are many available, or you can easily write one yourself in not too much time, but one that I am particularly fond of is called MagpieRSS. You can get it at: http://magpierss.sourceforge.net/

cscgal
The Queen of DaniWeb
Administrator
19,433 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
 

sorry,I don't familiar with it.Can you give me some codes or how to do in dreamweaver?

steven01
Light Poster
32 posts since Apr 2005
Reputation Points: 10
Solved Threads: 0
 
sorry,I don't familiar with it.Can you give me some codes or how to do in dreamweaver?

HI steven01

RSS is a way of syndicating site content.
The RSS file is an xml file with the RSS specification. That means its written to follow rules layed out for all RSS files. This allows any website or application to read the RSS file if it knows the RSS specification.

To use an RSS file, you have to have an application that will parse the RSS file.
This typically means, changing the xml in the RSS file, into HTML for display on your website.

So essentially what you have to do is:

1) know the RSS file location. http://somesite.com/rss.xml
2) Read the RSS files
3) Change each RSS tag ito a html tag.
4) Show this changes on your website.

So for example the xml:

[HTML]No Santahttp://www.weakgame.com/?show=5594
Sun, 25 Dec 2005 00:00:00 -0500[/HTML]

Can be parsed and show on your website as:

No Santa at Sun, 25 Dec 2005 00:00:00 -0500

- As you can see, the xml is just information, that you can display on your website. How you display this information, is up to you.

As for using dreamweaver.
Id go with using magpie: http://magpierss.sourceforge.net/
Or simply writing my own php code.
Dreamweaver id for formatting your code (making it easier to view), not writing code.

OK i'll write a simple php script to demonstrate how to read/parse RSS: (This is a very simple regex replacement, nothing standard)

This sample just lists the titles from an rss feed:

[PHP](.*)/", $rss, $matches); // match all the titles using a regex expression

// iterate through all matches
foreach ($matches as $title) {
echo $title[1]."
"; // display the title
}

?>[/PHP]

I havent tested the above code.
But it should clue you in.
preg_match_all is a regex expression (regular expression). You can seach google on that. :)

digital-ether
Nearly a Posting Virtuoso
Moderator
1,293 posts since Sep 2005
Reputation Points: 461
Solved Threads: 101
 

Dear Friend,
Please go to this link http://w3schools.com/php/php_ajax_rss_reader.asp
It has explained how to read RSS feed with very easy example and working successfully. You can visit my site in which I have used that example here http://sabsyp.com/rss/simple.php
It may take few seconds to load becaused it fetches RSS feed from most busy websites called Google and MSN.

Thank you.

joshisumitnet
Light Poster
26 posts since Jan 2009
Reputation Points: 9
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You