Solved

Is this the correct format for an RSS file?

Posted on 2009-05-12
9
388 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Owl Carousel 6 292
Getting attribute Values using xslt 4 67
Create animated movies for web page 18 163
Grunt script for Build Process 1 88
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

737 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