Solved

Is this the correct format for an RSS file?

Posted on 2009-05-12
9
378 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Format results with PHP 3 68
How to analyze web traffic logs 10 100
selectSingleNode in Access 2013 11 53
Field that has HTML displays the code instead of the text in html 16 60
I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
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…
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…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

914 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

17 Experts available now in Live!

Get 1:1 Help Now