Jump to content


Photo

automated rss publisher


  • Please log in to reply
4 replies to this topic

#1 Dville

Dville
  • Members
  • PipPipPip
  • Advanced Member
  • 88 posts

Posted 25 July 2006 - 11:01 PM

So I've been doing this digg clone, and would like to be able to publish RSS feeds. I looked around google and see the template for rss feeds. . .but none are 'automated'. So if someone were to add an article(at http://digg.sytes.net/digg), I would have to update the xml file. How can I make this 'automated/mysql' based? I thought it would be a simple mysql query with a limit of 10 or however many articles i wanted the rss feed to limit to. But I can't find anything that says this.

Anyone have a site/tutorial that has a good explaination of how to do this. Thanks in advanced.

#2 Dville

Dville
  • Members
  • PipPipPip
  • Advanced Member
  • 88 posts

Posted 25 July 2006 - 11:25 PM

I have now found how to do this. . .but see a couple issues.

1 - it doesnt update unless I run the file. So the xml file doesn't update unless I personally go to /digg/update_rss.php. How can this be automated.

2 - I get a validation error.
1. 	pubDate must be an RFC-822 date	 15	35
2. 	XML Parsing error: <unknown>:26:20: not well-formed (invalid token)	 26	20

when i open the xml file in IE i get
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. 


--------------------------------------------------------------------------------

Whitespace is not allowed at this location. Error processing resource 'file:///C:/www/digg/rss.xml'. Line 26, Position 21 

    <title> Search & Share</title>



So yea, if anyone knows of a tutorial, or anything that could assist me in these validation errors I would greatly appreciate it.

#3 ShogunWarrior

ShogunWarrior
  • Members
  • PipPipPip
  • Advanced Member
  • 528 posts
  • LocationIreland

Posted 25 July 2006 - 11:29 PM

Make sure your date format is the correct one, for example if you have it as mm/dd/yy h:i:s instead of dd, mm/yy h:i:s then it will throw an error.
Note:only an example, you'll have to look up the proper format.
You can use strtotime and date to reformat dates.
<a href="http://www.daviddora...nmedia.com/">My New Site/Blog</a> | <a href="http://www.daviddora...m/check/">Check your page for broken links/images/scripts</a>

Zend Certified Engineer
Follow me on Twitter: http://twitter.com/davidd

#4 Dville

Dville
  • Members
  • PipPipPip
  • Advanced Member
  • 88 posts

Posted 25 July 2006 - 11:48 PM

I did figure that out, and now I come across the & issue. I change that to '&#38;' and that fixes that. Wouldnt there be some sort of parser, that will automaticly change these things. Instead of me having to change them from the database.

#5 ShogunWarrior

ShogunWarrior
  • Members
  • PipPipPip
  • Advanced Member
  • 528 posts
  • LocationIreland

Posted 26 July 2006 - 05:07 PM

You can use htmlspecialchars_decode()
<a href="http://www.daviddora...nmedia.com/">My New Site/Blog</a> | <a href="http://www.daviddora...m/check/">Check your page for broken links/images/scripts</a>

Zend Certified Engineer
Follow me on Twitter: http://twitter.com/davidd




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users