Congratulations!

[Valid RSS] This is a valid RSS feed.

Recommendations

This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.

Source: http://www.anoccasionalverse.com/poem_feed.rss

  1. <?php
  2. ini_set("include_path",".:/home/davidd/php");
  3. require("db.php");
  4. include("functions.php");
  5.  
  6. header ("Content-type: text/xml"); // Output file as XML
  7.  
  8. ?>
  9.  
  10. <rss version="2.0">
  11. <channel>
  12. <title>An Occasional Verse - Daily Poem</title>
  13. <description>
  14. An Occasional Verse is Poetry for the Everyday Poet. A website devoted to enabling poets easy access to publishing their occasional verse, poetry collections, poems, lyrics, odes, songs and sonnets.  We give poets the ability to instantly publish their poems.  This feed is generated from our home page's Daily Poem section.  Every day a new poem is posted.
  15. </description>
  16. <link>http://www.anoccasionalverse.com</link>
  17. <language>en-us</language>
  18. <managingEditor>[email protected]</managingEditor>
  19. <webMaster>[email protected]</webMaster>
  20.  
  21. <?php
  22. dbConnect("davidd_poetry");
  23. $result = mysql_query ("SELECT PoemID,PostDate,UserID,Title,DateWritten,Poem from ind_poems where Posted='1' Order By PostDate DESC LIMIT 0,8")
  24. or die (mysql_error());
  25. //request all data for newest 3 items in feed from db
  26.  
  27. while ($row = mysql_fetch_array ($result))
  28. //loops through results of SELECT displaying each items data
  29. {
  30. $uid = $row[UserID];
  31. dbConnect("davidd_RegUsers");                
  32. $poetresult = mysql("davidd_RegUsers", "select name from RegUser where UserID = $uid limit 1");
  33. $poet = mysql_fetch_row($poetresult);
  34. $poetname = $poet[0];
  35. //Get Poet Name
  36.  
  37.    echo ("<item>
  38.    <title>");
  39.    $Title = str_replace("\x92","'", $row[Title]);
  40.    $Title = str_replace("\x93","\"",$Title);
  41.    $Title = str_replace("\x94","\"",$Title);
  42.    echo htmlentities($Title,ENT_NOQUOTES);
  43.    
  44.    echo ("</title>
  45.  
  46.    <link>http://www.anoccasionalverse.com/poems/$row[PoemID]</link>
  47.  
  48.    <pubDate>");
  49.  
  50. $postdate = convertDate($row[PostDate], "D, d M Y H:i:s T");
  51.    echo $postdate;
  52.  
  53.    echo ("</pubDate>
  54. <category>Poetry</category>
  55.    <guid>http://www.anoccasionalverse.com/poems/$row[PoemID]</guid>
  56.  
  57.    <description>");
  58.  
  59. $poetdisp = "Written By: " . $poetname . "<br><br>";
  60. echo htmlspecialchars($poetdisp);
  61. $date = convertDate($row[DateWritten], "F d, Y");
  62.    $datedisp = $date . "<br><br>";
  63.    echo htmlspecialchars($datedisp);
  64.    $Poem = str_replace("\x92","'", $row[Poem] );
  65.    $Poem = str_replace("\x93","\"", $Poem );
  66.    $Poem = str_replace("\x94","\"", $Poem );
  67.    echo htmlentities($Poem,ENT_NOQUOTES);
  68.    //this handy php function makes sure the XML is well formed by changing & " ' < > into html entities
  69.    //www.php.net/htmlspecialchars
  70.    
  71.    echo ("</description>
  72.    
  73. </item>\n\n");
  74. }
  75.  
  76. unset($result,$row,$poet,$poetresult,$poetname,$poetdisp,$datedisp,$date,$Poem); //destroys variables so the var names can be reused
  77.  
  78. ?>
  79. </channel>
  80. </rss>

If you would like to create a banner that links to this page (i.e. this validation result), do the following:

  1. Download the "valid RSS" banner.

  2. Upload the image to your own server. (This step is important. Please do not link directly to the image on this server.)

  3. Add this HTML to your page (change the image src attribute if necessary):

If you would like to create a text link instead, here is the URL you can use:

http://www.feedvalidator.org/check.cgi?url=http%3A//www.anoccasionalverse.com/poem_feed.rss

Copyright © 2002-9 Sam Ruby, Mark Pilgrim, Joseph Walton, and Phil Ringnalda