/    Sign up×
Community /Pin to ProfileBookmark

Display RSS feed in website.

I am trying to display some RSS feeds on my site. I have tried a bit of searching on ‘google’ and found there are readymade scripts available.
If I want to do this from scratch, what should I know to be able to do so? I know a little PHP and have been hovering over w3schools.org XML tutorial… trying to learn what technologies are involved.
Any inputs on what I should learn to achieve this task is appreciated.. !

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@JonaJan 21.2005 — [font=trebuchet ms]It's as simple as looking at someone else's RSS feed (of the same version you want to use, of course). Then take your PHP knowledge and create output that will be identical, with the exception of content, to your example's XML. Finally, once you've got it all formatted correctly (in order to see your source, you might send a text/ascii header), send an XML header.[/font]

[code=php]
<?php
header('Content-Type: text/xml');
# output for XML here
?>
[/code]
Copy linkTweet thisAlerts:
@web101authorFeb 03.2005 — Thanks for you reply. But it has taken me a while to understand things.

I finally used this article to parse the rss feed content with the PHP SAX parser.

http://www.sitepoint.com/article/php-xml-parsing-rss-1-0

Now, the next step,

Each day, I need to display the curent day's RSS feed and store the previous day's RSS feed and create a sitemap to the previous days' feeds.

How do I go about doing this ?

Store each day RSS file's content into a MYSQL database .. ? and if I have to store ... how do i store ? transfer the file contents into a string and store it ?

Or better copy the file contents on to my machine and just store the path to that file in the database?
Copy linkTweet thisAlerts:
@JonaFeb 03.2005 — [font=trebuchet ms]I would say to generate the XML file via PHP/MySQL, and then retrieve the data from the MySQL database wherever necessary (even on your archives pages).[/font]
×

Success!

Help @web101 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...