Jump to content
xisto Community
.hack//GU

Use Rss In Php Code

Recommended Posts

You want to read the RSS feed from another website and put it on yours, yes?

 

You'll need some way to parse the XML file that makes up the RSS feed. One of the easiest ways I've found to do this is to use the Zend Framework, and more specifically the Feed Component. Of course, downloading and then uploading the Zend Framework can take a bit of time (although it is incredibly useful for loads of different things), so there is another method you can use.

 

PHP has a collection of XML-parsing functions available. Of course, this means more manual work than using the Zend Framework. There is also a section called XMLReader which may be useful. You will need to know the format of the feed, and manually work your way through all the meta-data before moving on to the actual news items, then working through those. I don't have any code to hand, but it should be pretty easy to work out while looking at an example RSS 2.0 file to get the structure right.

 

You'll need to get the title, link, description, etc. so people know where this feed is coming from. Then you will need to loop through each item and pull out the title, link, description and main content.

Share this post


Link to post
Share on other sites

If you are php savvy, you might want to download a copy of the snews cms software (free) and have a look at their RSS functions.

Share this post


Link to post
Share on other sites

To expand a bit on the RSS feeds a bit you can use several php software programs such as cute news, wordpress, joomla, php nuke as they have built in RSS feed fuctions to help you automate the process. Of course if you feel adventerous you can build some by scratch then check out these tutorials and stuff.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.