Solved

Is this the correct format for an RSS file?

Posted on 2009-05-12
9
375 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
  • 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 108

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
 
LVL 108

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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

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 108

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 108

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
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 …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now