Advertisement

06.26.2008 at 07:42PM PDT, ID: 23520513
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.3

XML Podcast Feed creation in ASP Help

Asked by elevatedmarketing in Active Server Pages (ASP), Web Languages/Standards, Extensible Markup Language (XML)

Tags:

I have an admin user interface for a client where he lists radio shows through the interface.  He now wants to podcast.  I've created the XML creation tool, but I need to tweak it a bit.  My main issue is my code is putting an unwanted blank line in line 1, which is causing my feed to NOT validate, using feedvalidator.org.  Below is my code for the XML creation page.  In my next post, I will post the XML code it creates.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
<!--#include file="secure.asp"-->
<!--#include file="openConn.asp"-->
<%
Function return_RFC822_Date(myDate, offset)
   Dim myDay, myDays, myMonth, myYear
   Dim myHours, myMonths, mySeconds
 
   myDate = CDate(myDate)
   myDay = WeekdayName(Weekday(myDate),true)
   myDays = Day(myDate)
   myMonth = MonthName(Month(myDate), true)
   myYear = Year(myDate)
   myHours = zeroPad(Hour(myDate), 2)
   myMinutes = zeroPad(Minute(myDate), 2)
   mySeconds = zeroPad(Second(myDate), 2)
 
   return_RFC822_Date = myDay&", "& _
                                  myDays&" "& _
                                  myMonth&" "& _ 
                                  myYear&" "& _
                                  offset
End Function 
Function zeroPad(m, t)
   zeroPad = String(t-Len(m),"0")&m
End Function
%>
<%
Dim strXml
     strXml = strXml & vbcrlf & "<?xml version=""1.0"" encoding=""utf-8""?>"
     strXml = strXml & vbcrlf & "<rss xmlns:itunes=""http://www.itunes.com/dtds/podcast-1.0.dtd"" version=""2.0"">"
     strXml = strXml & vbcrlf & " "
     strXml = strXml & vbcrlf & "     <channel>"
     strXml = strXml & vbcrlf & "          <ttl>60</ttl>"
     strXml = strXml & vbcrlf & "          <title>The Expat Show</title>"
     strXml = strXml & vbcrlf & "          <link>http://www.theexpatshow.com/index.asp</link>"
     strXml = strXml & vbcrlf & "          <language>en-us</language>"
     strXml = strXml & vbcrlf & "          <copyright>&#xA9; 2008 TaiCo Productions</copyright>"
     strXml = strXml & vbcrlf & "          <description>&quot;The ExPat Show&#x2122;,&quot; hosted by Tai Aguirre, examines the political, lifestyle, cultural and financial issues surrounding the record numbers of Americans relocating overseas. Called &quot;radio's first real global show,&quot; Tai Aguirre brings listeners first-hand accounts of ExPats&apos; real-life adventures and experiences. The show considers the surrounding issues of living life abroad through interviews with a panoply of experts in culture, business, law, real estate, etc.</description>"
     strXml = strXml & vbcrlf & "          <managingEditor>tai@theexpatshow.com (Tai Aguirre)</managingEditor>"
     strXml = strXml & vbcrlf & "          <webMaster>adam@elevatedmarketing.com</webMaster>"
     strXml = strXml & vbcrlf & "          <pubDate>Sat, 21 Jun 2008 10:00:00 EST</pubDate>"
     strXml = strXml & vbcrlf & "          <generator>Elevated Marketing and Design</generator>"
     strXml = strXml & vbcrlf & "          <itunes:category text=""Society &amp; Culture"">"
     strXml = strXml & vbcrlf & "               <itunes:category text=""Places &amp; Travel"" />"
     strXml = strXml & vbcrlf & "               </itunes:category>"
     strXml = strXml & vbcrlf & "          <itunes:link rel=""image"" type=""video/jpg"" href=""http://www.theexpatshow.com/podcast/art-144.jpg"">The Expat Show with Tai Aguirre</itunes:link>"
     strXml = strXml & vbcrlf & "          <itunes:image rel=""image"" type=""video/jpeg"" href=""http://www.theexpatshow.com/podcast/art-144.jpg"">The Expat Show with Tai Aguirre</itunes:image>"
     strXml = strXml & vbcrlf & "          <image>"
     strXml = strXml & vbcrlf & "               <url>http://www.theexpatshow.com/podcast/art-144.jpg</url>"
     strXml = strXml & vbcrlf & "               <title>The Expat Show&#x2122;</title>"
     strXml = strXml & vbcrlf & "               <link>http://www.theexpatshow.com/</link>"
     strXml = strXml & vbcrlf & "               <width>144</width>"
     strXml = strXml & vbcrlf & "               <height>144</height>"
     strXml = strXml & vbcrlf & "               <link>http://www.theexpatshow.com</link>"
     strXml = strXml & vbcrlf & "          </image>"
     strXml = strXml & vbcrlf & "          <itunes:link rel=""image"" type=""video/jpg"" href=""http://www.theexpatshow.com/podcast/art-144.jpg"">The Expat Show with Tai Aguirre</itunes:link>"
     strXml = strXml & vbcrlf & "          <itunes:subtitle>The Global Show for and about Expatriates</itunes:subtitle>"
     strXml = strXml & vbcrlf & "          <itunes:author>Tai Aguirre</itunes:author>"
     strXml = strXml & vbcrlf & "          <itunes:summary>&quot;The ExPat Show&#x2122;,&quot; hosted by Tai Aguirre, examines the political, lifestyle, cultural and financial issues surrounding the record numbers of Americans relocating overseas. Called &quot;radio's first real global show,&quot; Tai Aguirre brings listeners first-hand accounts of ExPats&apos; real-life adventures and experiences. The show considers the surrounding issues of living life abroad through interviews with a panoply of experts in culture, business, law, real estate, etc.</itunes:summary>"
     strXml = strXml & vbcrlf & "          <itunes:owner>"
     strXml = strXml & vbcrlf & "               <itunes:name>Tai Aguirre</itunes:name>"
     strXml = strXml & vbcrlf & "               <itunes:email>tai@theexpatshow.com</itunes:email>"
     strXml = strXml & vbcrlf & "               </itunes:owner>"
     strXml = strXml & vbcrlf & "          <itunes:image href=""http://www.theexpatshow.com/podcast/art-300.jpg"" />"
     strXml = strXml & vbcrlf & "          <itunes:category text=""Society &amp; Culture"">"
     strXml = strXml & vbcrlf & "               <itunes:category text=""Places &amp; Travel"" />"
     strXml = strXml & vbcrlf & "          </itunes:category>"
     strXml = strXml & vbcrlf & "          <itunes:explicit>no</itunes:explicit>"
     strXml = strXml & vbcrlf & "          <itunes:block>no</itunes:block>"
     strXml = strXml & vbcrlf & "          <itunes:keywords>expat, expatriate, americans living abroad, travel, Tai Aguirre, relocate, overseas, international, usa, united states</itunes:keywords>"
     strXml = strXml & vbcrlf & " "
 
Set rsCat = Server.CreateObject("ADODB.Recordset")
sqlCat = "SELECT * from shows where type='Show' AND (listlive='both' OR listlive='podcast') AND Date < #" & now() & "# ORDER BY Date desc"
rsCat.Open sqlCat,Conn, 3, 3, 1
 
do until rsCat.EOF
 
     strXml = strXml & vbcrlf & "          <item>"
     strXml = strXml & vbcrlf & "               <title>" & rsCat("title") & "</title>"
     strXml = strXml & vbcrlf & "               <author>tai@theexpatshow.com</author>"
     strXml = strXml & vbcrlf & "               <description>" & rsCat("teaser") & "</description>"
     strXml = strXml & vbcrlf & "               <itunes:author>Tai Aguirre</itunes:author>"
     strXml = strXml & vbcrlf & "               <itunes:subtitle>" & rsCat("teaser") & "</itunes:subtitle>"
     strXml = strXml & vbcrlf & "               <itunes:summary>" & rsCat("teaser") & "</itunes:summary>"
     strXml = strXml & vbcrlf & "               <enclosure url=""" & rsCat("audio") & """ length=""1967"" type=""audio/mpeg"" />"
     strXml = strXml & vbcrlf & "               <guid>" & rsCat("audio") & "</guid>"
     
     strXml = strXml & vbcrlf & "               <pubDate>" & return_RFC822_Date(rsCat("date"), "10:00:00 EST") & "</pubDate>"
 
     strXml = strXml & vbcrlf & "               <itunes:duration>01:00:00</itunes:duration>"
     strXml = strXml & vbcrlf & "               <itunes:keywords>" & rsCat("keywords") & "</itunes:keywords>"
     strXml = strXml & vbcrlf & "          </item>"
     strXml = strXml & vbcrlf & " "
          
rsCat.MoveNext
Loop
rsCat.Close
strXml = strXml & vbcrlf & "     </channel>"
strXml = strXml & vbcrlf & "</rss>"
 
Set fsys = Server.CreateObject("SCRIPTING.FileSystemObject")
 
fileName = Server.MapPath("\podcast\") & "\test123.xml"
Set fo = fsys.createTextFile(fileName, true)
fo.WriteLine strXml
fo.Close
 
Response.Write strXml
 
%>
[+][-]06.26.2008 at 07:43PM PDT, ID: 21880665

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.26.2008 at 07:44PM PDT, ID: 21880668

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.27.2008 at 07:57AM PDT, ID: 21884443

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Active Server Pages (ASP), Web Languages/Standards, Extensible Markup Language (XML)
Tags: asp, xml
Sign Up Now!
Solution Provided By: squillman
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628