Solved

Is this the correct format for an RSS file?

Posted on 2009-05-12
9
392 Views
Last Modified: 2013-11-18
I am new to the RSS area, however I created a PHP script that generates an RSS feed file from a database of sermons... this feed however is being glitchy and has not displayed new feeds for some time and doesn't work all the time. Itunes does not recognize it as a valid podcast.

Is the following the correct format? If not, how do I fix it?
<?xml version="1.0"?>
	
	  <rss version="2.0">
	
	  <channel>
	
	  <title>IRCUMC</title>
	  <link>http://www.ircumc.com/new/teachings/20090125.mp3</link>
	  <description>Sermon</description>
	  <language>en-us</language>
	  <copyright>2009</copyright>
	  <lastBuildDate>Fri, 30 Jan 2009 12:00:00 EST</lastBuildDate>
	  <webMaster>adams@swtwebdesign.com (Joshua Adams)</webMaster>
	  <ttl>1</ttl>
	  
		  <item>
			  <title>Jan. 25, 2009, Rev. Jim Govatos<br>Life on Purpose: Health</title>
			  <description></description>
			  <pubDate>Sat, 21 Feb 2009 10:01:00 EST</pubDate>
			  <enclosure url="http://www.ircumc.com/new/teachings/20090125.mp3" length="1" type="audio/mpeg"/>
		  </item>
		  
		  <item>
			  <title>Feb. 1, 2009,  Rev. Ginger Doherty<br>Life on Purpose: Spiritual Gifts</title>
			  <description></description>
			  <pubDate>Sat, 21 Feb 2009 10:04:07 EST</pubDate>
			  <enclosure url="http://www.ircumc.com/new/teachings/20090201.mp3" length="1" type="audio/mpeg"/>
		  </item>
		  
		  <item>
			  <title>Feb. 8, 2009, Rev. Jim Govatos<br>Love for Family</title>
			  <description></description>
			  <pubDate>Sat, 21 Feb 2009 10:09:41 EST</pubDate>
			  <enclosure url="http://www.ircumc.com/new/teachings/20090208.mp3" length="1" type="audio/mpeg"/>
		  </item>
		  
		  <item>
			  <title>Feb. 15, 2009, Rev. Jim Govatos<br>Love for Church Family</title>
			  <description></description>
			  <pubDate>Sat, 21 Feb 2009 10:11:39 EST</pubDate>
			  <enclosure url="http://www.ircumc.com/new/teachings/20090215.mp3" length="1" type="audio/mpeg"/>
		  </item>
		  
	   </channel>
	   </rss>

Open in new window

0
Comment
Question by:swtwebdesign
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 5

Assisted Solution

by:cmaohio
cmaohio earned 200 total points
ID: 24364222
Attached is the code I use for my iTunes RSS for podcasts.

One thing I ensured I did was put all the RSS data into a variable and then outputted it in UTF format. That was important for it to be accepted properly.

So, all data was put into an $xml variable and then I outputted this:

header('Content-Type: application/xml; charset=utf-8', true);
echo utf8_encode($xml);

More Information on the iTunes format is here: http://www.apple.com/itunes/whatson/podcasts/specs.html
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:itunes="http://www.itunes.com/DTDs/Podcast-1.0.dtd" version="2.0">
    <channel>
        <title>My Podcast</title>
        <link>http://www.mysite.org/</link>
        <itunes:summary>Summary of cast</itunes:summary>
        <itunes:author>Staff</itunes:author>
        <language>en-us</language>
 
        <copyright>&#xA9; 2009 My site</copyright>
        <itunes:owner>
            <itunes:name>Owner-Name</itunes:name>
            <itunes:email>user@domain.com</itunes:email>
        </itunes:owner>
        <itunes:image href="http://www.mysite.org/images/podcast_logo.jpg" />
        <itunes:category text="top category">
 
            <itunes:category text="sub category" />
        </itunes:category>
        <item>
            <title>Podcast title</title>
            <itunes:author>author of podcast</itunes:author>
            <itunes:summary>Description of episode</itunes:summary>
            <enclosure url="http://podcasts.mysite.org/2008/episodexx.mp3" length="10782511" type="audio/x-mp3" />
 
            <pubDate>Tue, 16 Sep 2008 19:00:00 PDT</pubDate>
            <itunes:duration>25:23</itunes:duration>
        </item>
    </channel>
</rss>

Open in new window

0
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 300 total points
ID: 24377951
View the source code on this page.  If you have any questions you can phone me at my church office at 202.537.7560.  I'm not always there, but I can call you back.  Best, ~Ray

http://www.nationalpres.org/rss/sermons.xml
0
 

Author Comment

by:swtwebdesign
ID: 24438275
Thats fantastic! Thanks! Now to figure out how to have my script figure out how big each file is to put that in the feed....
0
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 
LVL 110

Expert Comment

by:Ray Paseur
ID: 24443729
Thanks for the points.  Use this to get the file size.  Best, ~Ray

http://us3.php.net/manual/en/function.filesize.php
0
 

Author Comment

by:swtwebdesign
ID: 24444882
I was trying that with no success... turns out it looks like I had a typo.. time to try it again.

Also, if I just want to creat an RSS feed forthe site news, how should that look? I'm sure no Itunes info.
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 24445131
Best to check the path/to/the/file if you're having trouble with filesize() - but see also the user notes on that page - there are some good suggestions for dealing with larger file sizes.

Here is a sample of a basic RSS feed for a news page.  There is a cron job that creates it whenever the client adds a PDF of news to the directory.  Good documentation here:
http://cyber.law.harvard.edu/rss/rss.html


<?xml version="1.0" encoding="ISO-8859-1"?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss">
<!-- -->
<!-- -->
<!--     IF YOU CAN SEE THIS, YOU NEED AN RSS READER!   -->
<!-- -->
<!-- -->
<channel>
<title>National Trust Community Investment Corporation News</title>
<link>http://www.NTCICFunds.com/</link>
<description>NTCIC makes equity investments in real estate projects that qualify for historic tax credits.</description>
<language>en-us</language>
<pubDate>Wed, 07 Jan 2009 15:00:02 CST</pubDate>
 
<image>
<url>http://NTCICFunds.com/images/ntcic_rss_logo.png</url>
<title>NTCIC Web Site</title>
<link>http://www.NTCICFunds.com/</link>
</image>
<item>
<title>NTCIC News Updated on Wed, 07 Jan 2009 15:00:02 CST!</title>
<link>http://www.NTCICFunds.com/news/</link>
<description>The RSS Feed from www.NTCICFunds.com has been updated.</description>
<pubDate>Wed, 07 Jan 2009 15:00:02 CST</pubDate>
 
</item>
</channel>
</rss>

Open in new window

0
 

Author Comment

by:swtwebdesign
ID: 24445427
I will give this a try. I have been trying my best to get this to work and it doesnt seem to want to work for me. This time around I am generating the script from a database of news entries. I cant get it to come out right.

Also, is it possible to have html tags in some of the rss content or does it have to be straight text?
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 24445462
"...html tags in some of the rss content..." - who knows?  I have never seen it.
0
 

Author Comment

by:swtwebdesign
ID: 24445587
Finally! Success! I was able to get the tags converted to HTML entities and thus get it to work with the xml tags using PHP htmlspecialchars().

http://ircumc.com/news.rss is the feed currently generated.
0

Featured Post

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question