Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting embedded images from RSS feed

Status
Not open for further replies.

ralphonzo

Programmer
Apr 9, 2003
228
GB
Hi, I've been going bonkers trying to format the data from an RSS feed. The problem I'm having is with the image/text wrap. Is it possible to disable that?

Here's the code I'm using:

Code:
dim xmlDom, nodeCol, oNode, oChildNode
			set xmlDom = Server.CreateObject("MSXML2.Domdocument.4.0")
			
			call xmlDom.setProperty("ServerHTTPRequest", true)
			xmlDom.async = false
			'call xmlDom.load("[URL unfurl="true"]http://feeds.feedburner.com/Techcrunch")[/URL]
			call xmlDom.load("[URL unfurl="true"]http://www.postconflictheritage.com/home/pch_blog/rss.xml")[/URL]
			
			if not xmlDom.documentElement is nothing then
			  set nodeCol = xmlDom.documentElement.selectNodes("channel/item")
			  for each oNode in nodeCol
				Response.Write("<p>" & vbCrLf)
				set oChildNode = oNode.selectSingleNode("title")
				if not oChildNode is nothing then
				  Response.Write("  <h3>" & oChildNode.text & "</h3>" & vbCrLf)
				end if
				set oChildNode = oNode.selectSingleNode("pubDate")
				if not oChildNode is nothing then
				  Response.Write("  &raquo; " & oChildNode.text & "<br />" & vbCrLf)
				end if
				set oChildNode = oNode.selectSingleNode("description")
				if not oChildNode is nothing then
				  Response.Write("  " & oChildNode.text & "<br />" & vbCrLf)
				end if
				set oChildNode = oNode.selectSingleNode("link")
				if not oChildNode is nothing then
				  Response.Write("  <br />" & vbCrLf)
				  Response.Write("  <a href=""" & oChildNode.text & """ target=""_blank"">")
				  Response.Write("    more..." & vbCrLf)
				  Response.Write("  </a>" & vbCrLf)
				end if
				Response.Write("</p>" & vbCrLf)
			  next
			else
			  Response.Write("<p>" & vbCrLf)
			  Response.Write("  Sorry, no news today!" & vbCrLf)
			  Response.Write("</p>" & vbCrLf)
			end if

Any thoughts?
 
Does nobody know? Are there any better scripts to use?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top