Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Is this the correct format for an RSS file?

Posted on 2009-05-12
9
Medium Priority
?
407 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 800 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 111

Accepted Solution

by:
Ray Paseur earned 1200 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 111

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 111

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 111

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
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…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

636 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