Jump to content

PHP -> RSS


yyx748

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/168655-php-rss/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/168655-php-rss/#findComment-889770
Share on other sites

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");

Link to comment
https://forums.phpfreaks.com/topic/168655-php-rss/#findComment-890409
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/168655-php-rss/#findComment-890410
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.