yyx748 Posted August 3, 2009 Share Posted August 3, 2009 Basically I created an entire PHP website from scratch and did not use CMS like Wordpress. EXAMPLE OF MY DATABASE Title: example Date: 2009-09-09 [time not recorded] Article: <p><img src="xxx"></p><p>Today there was a huge thunderstorm</p> Link of page: article.php?id=23 Now I wanna generate an RSS feed such that it could fit into a website such as http://blog.xin.sg/Singapore some RSS features that i think are required are [*]Title [*]Description (think it excludes videos and images, perhaps just a few lines of text) [*]Content (think it includes videos and images) [*]PubDate [*]Link to article [*]Link to comments But now the question is I'm completely new to RSS. I have no idea how to do it cuz its quite different from HTML. There are things like CDATA, guid and there are no <p> for paragraphs. Is there any tutorial online that or anyone can teach me how to do it step by step? Quote Link to comment https://forums.phpfreaks.com/topic/168655-php-rss/ Share on other sites More sharing options...
RichardRotterdam Posted August 3, 2009 Share Posted August 3, 2009 RSS is nothing more then a XML. Do a select query and echo it out as RSS. What part are you stuck on? Quote Link to comment https://forums.phpfreaks.com/topic/168655-php-rss/#findComment-889696 Share on other sites More sharing options...
yyx748 Posted August 3, 2009 Author Share Posted August 3, 2009 Im stuck on the structure of RSS.... There are things like CDATA, guid and there are no <p> for paragraphs. Quote Link to comment https://forums.phpfreaks.com/topic/168655-php-rss/#findComment-889698 Share on other sites More sharing options...
gevans Posted August 3, 2009 Share Posted August 3, 2009 You need to look at a rss tutorial, not worry about the php yet. Take a look at an rss feed, even this site. Figure out what part of the xml feeds the actual feed. Quote Link to comment https://forums.phpfreaks.com/topic/168655-php-rss/#findComment-889701 Share on other sites More sharing options...
yyx748 Posted August 3, 2009 Author Share Posted August 3, 2009 also the file would be feed.rss right?? Will .RSS extention run php?? Or am i suppose to use php to create an RSS file? Then wouldnt that mean i have to modify my "ADD NEWS" php such that everything i add/modify a news, my RSS file would get updated? A bit troublesome... Quote Link to comment https://forums.phpfreaks.com/topic/168655-php-rss/#findComment-889702 Share on other sites More sharing options...
gevans Posted August 3, 2009 Share Posted August 3, 2009 http://www.ibm.com/developerworks/library/x-phprss/ first tutorial i found on google. Have a read of that. Will be faster than asking how to do every step. If there's any of that you don't understand just ask Quote Link to comment https://forums.phpfreaks.com/topic/168655-php-rss/#findComment-889703 Share on other sites More sharing options...
yyx748 Posted August 3, 2009 Author Share Posted August 3, 2009 Thanks so much! Quote Link to comment https://forums.phpfreaks.com/topic/168655-php-rss/#findComment-889705 Share on other sites More sharing options...
yyx748 Posted August 3, 2009 Author Share Posted August 3, 2009 alright so i managed to get things working by refering to the website as well as the format from blogger and wordpress... Seems to be working but using the validator, there are some errors that i dunno how to solve.... anyone can help me? http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fphyllisquek.com%2Ffeed%2F Also, in mozilla, when i right click to view source, its just a ugly chunk of data unlike other website where tags and certain text are colored and bold Quote Link to comment https://forums.phpfreaks.com/topic/168655-php-rss/#findComment-889770 Share on other sites More sharing options...
yyx748 Posted August 4, 2009 Author Share Posted August 4, 2009 Nobody? Quote Link to comment https://forums.phpfreaks.com/topic/168655-php-rss/#findComment-890407 Share on other sites More sharing options...
RichardRotterdam Posted August 4, 2009 Share Posted August 4, 2009 alright so i managed to get things working by refering to the website as well as the format from blogger and wordpress... Seems to be working but using the validator, there are some errors that i dunno how to solve.... anyone can help me? http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fphyllisquek.com%2Ffeed%2F Those are not errors but recommendations. The description on those recommendations are pretty obvious though. Also, in mozilla, when i right click to view source, its just a ugly chunk of data unlike other website where tags and certain text are colored and bold Those are just text highlighting it shouldn't really matter. Have you tried setting an xml header? header ("content-type: text/xml"); Quote Link to comment https://forums.phpfreaks.com/topic/168655-php-rss/#findComment-890409 Share on other sites More sharing options...
gevans Posted August 4, 2009 Share Posted August 4, 2009 Seems to be working but using the validator, there are some errors that i dunno how to solve.... anyone can help me? http://feedvalidator.org/check.cgi?url=http%3A%2F%2Fphyllisquek.com%2Ffeed%2F There are only 3 recomendations, your feed passes. line 13: remove rel:"self" line 25: you need the full URL for the image line 48: you can't embed flash etc. in a feed Also, in mozilla, when i right click to view source, its just a ugly chunk of data unlike other website where tags and certain text are colored and bold I don't know that much about building rss feeds, but I'd compare it to someone else's source and see what the differences are. Quote Link to comment https://forums.phpfreaks.com/topic/168655-php-rss/#findComment-890410 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.