• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2222
  • Last Modified:

Displaying an image in and enclosure tag with ASP

I found this solution: http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/RSS/Q_23680954.html but when I run my code at http://www.oneonta.edu/library/andy/rssnews-DLM.asp I don't get the images. Has the code changed since it was posted in '08?

Any help would be appreciated.
0
mosemandl1974
Asked:
mosemandl1974
  • 4
  • 3
1 Solution
 
kevp75Commented:
can you show us the original feed so we can see the source of it?
0
 
mosemandl1974Author Commented:
0
 
kevp75Commented:
link to the feed please...  not the blog. :)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
mosemandl1974Author Commented:
0
 
kevp75Commented:
This:
<%
 Response.Expires = -1
 
 ' ##### URL to RSS Feed to display #########
 URLToRSS = "http://aristotle.oneonta.edu/wordpress/news/feed/"
 
 ' ##### max number of displayed items #####
 MaxNumberOfItems = 1
 
 ' ##### Main template constants
 MainTemplateHeader = "<table>"
 MainTemplateFooter = "</table>"
 
 Keyword1 =  ""  ' Keyword1 =  "tech" - set non-empty keyword value to filter by this keyword
 Keyword2 = "" ' Keyword1 =  "win" - set non-empty keyword value to filter by this keyword
' #################################
 
 ' ##### Item template.
 ' ##### {LINK} will be replaced with item link
 ' ##### {TITLE} will be replaced with item title
 ' ##### {DESCRIPTION} will be replaced with item description
  '##### {ENCLOSURE_URL} will be replaced with Media URL
' ##### {ENCLOSURE_TYPE} will be replaced with Media title
' ##### {ENCLOSURE_SIZE} will be replaced with Media file size in KB
 ItemTemplate = "<tr><td><a href=" & """{LINK}""" & "target='_blank'><b><font size=3>{TITLE}</font></b></a><img src=" & "{ENCLOSURE_URL}" & "><BR>{DESCRIPTION}{ENCLOSURE_URL}</td></tr>"
 
 ' ##### Error message that will be displayed if not items etc
 ErrorMessage = "Error has occured while trying to process " &URLToRSS & "<BR>Please contact web-master"
 
 ' ================================================
 
 Set xmlHttp = Server.CreateObject("MSXML2.XMLHTTP.3.0")
 xmlHttp.Open "Get", URLToRSS, false
 xmlHttp.Send()
 RSSXML = xmlHttp.ResponseText
 
 Set xmlDOM = Server.CreateObject("MSXML2.DomDocument.3.0")
 xmlDOM.async = false
 xmlDOM.LoadXml(RSSXML)
 
 Set xmlHttp = Nothing ' clear HTTP object
 
 Set RSSItems = xmlDOM.getElementsByTagName("item") ' collect all "items" from downloaded RSS
 Set xmlDOM = Nothing ' clear XML
 
 RSSItemsCount = RSSItems.Length-1
 
 ' writing Header
 if RSSItemsCount > 0 then 
  Response.Write MainTemplateHeader
 End If
 
 j = -1
 
 For i = 0 To RSSItemsCount
 Set RSSItem = RSSItems.Item(i)
 
  for each child in RSSItem.childNodes
   Select case lcase(child.nodeName)
     case "title"
           RSStitle = child.text
     case "link"
           RSSlink = child.text
     case "description"
           RSSdescription = child.text
     case "enclosure"
           RSSenclosure =  child.text
	 'case "enclosure_url"
           RSSenclosure_url =  child.getAttribute("url")
	 case "enclosure_type"
           RSSenclosure_type =  at.text
   End Select
  next
 
' now check filter
 If (InStr(RSSTitle,Keyword1)>0) or (InStr(RSSTitle,Keyword2)>0) or (InStr(RSSDescription,Keyword1)>0) or (InStr(RSSDescription,Keyword2)>0) then
 
  j = J+1
 
  if J<MaxNumberOfItems then 
  ItemContent = Replace(ItemTemplate,"{LINK}",RSSlink)
  ItemContent = Replace(ItemContent,"{TITLE}",RSSTitle)
  ItemContent = Replace(ItemContent,"{ENCLOSURE}",RSSenclosure)  
   ItemContent = Replace(ItemContent,"{ENCLOSURE_URL}",RSSenclosure_url)   
  Response.Write Replace(ItemContent,"{DESCRIPTION}",RSSDescription)
 
  ItemContent = ""
  End if
End If 
 
 Next
 
 ' writing Footer
 if RSSItemsCount > 0 then 
  Response.Write MainTemplateFooter
 else 
  Response.Write ErrorMessage
 End If
 
' Response.End
%>

Open in new window


Works for me: http://manager.zipcm.com/ 
0
 
mosemandl1974Author Commented:
Thank you!
0
 
kevp75Commented:
any time
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now