RSS feed for ASP site

Discussion in 'XML & RSS' started by hershel, Jun 29, 2006.

  1. #1
    i need to post an rss feed on my ASP site so that i can display the latest undustry news on my homepage.

    I used a javascript converter site:

    http://jade.mcli.dist.maricopa.edu

    And it worked fine ... until their site went down temporarily and this had a negative effect on my webpage - It wouldn't load!! -

    Does anyone have any better suggestions as to how i can incorporate an rss feed into my webpage without using third party sites that may crash!

    Thanks
     
    hershel, Jun 29, 2006 IP
  2. weppos

    weppos Well-Known Member

    Messages:
    99
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    125
    #2
    Using the object

    Set objXML = Server.CreateObject("msxml2.DOMDocument.3.0")
    Code (markup):
    you can parse and XML feed and display it in you web pages using ASP. :)
     
    weppos, Jun 30, 2006 IP
  3. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #3
    ludwig, Jun 30, 2006 IP
  4. hershel

    hershel Member

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    Thanks for your help - i have read this soultion but fear that my grasp of javascript is going to let me down!

    Is there a simple way of adding the rss feed to my site - or an online tutorial that you know of? All of the javascript generators that i find seem to be coded in php!!
     
    hershel, Jul 7, 2006 IP
  5. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #5
    I think you haven't noticed this code:

    It's pure ASP:

    <%
    strPANURL = "http://www.panarmenian.net/stickers/news/news_eng.rss"
    
    dim xmlDom, nodeCol, oNode, oChildNode
    set xmlDom = Server.CreateObject("MSXML2.Domdocument")
    xmlDOM.async = False
    
    call xmlDom.setProperty("ServerHTTPRequest", true)
    xmlDom.async = false
    call xmlDom.load(strPANURL)
    
    if not xmlDom.documentElement is nothing then
      set nodeCol = xmlDom.documentElement.selectNodes("channel/item")
      i = 1
      for each oNode in nodeCol
        Response.Write("<div class='footer'>" & vbCrLf)
        set oChildNode = oNode.selectSingleNode("pubDate")
        if not oChildNode is nothing then
    		strPubDate = Server.HTMLEncode(oChildNode.text)
    		strPubDate = replace(strPubDate, "&apos;", "'")
    		strPubDate = replace(strPubDate, "&amp;", "&")
    		strPubDate = replace(strPubDate, vbCrLf, "<br>")
          Response.Write("<strong>" & strPubDate & "</strong><br>" & vbCrLf)
        end if
        set oChildNode = oNode.selectSingleNode("link")
        if not oChildNode is nothing then
          Response.Write("  <a href='" & oChildNode.text & "' target='_blank' class='footer' style='color: #CC0000;'>")
    	  strLink = "yes"
        end if
        set oChildNode = oNode.selectSingleNode("title")
        if not oChildNode is nothing then
    		strTitle = Server.HTMLEncode(oChildNode.text)
    		strTitle = replace(strTitle, "&apos;", "'")
    		strTitle = replace(strTitle, "&amp;", "&")
    		strTitle = replace(strTitle, vbCrLf, "<br>")
          Response.Write("" & strTitle & "")
        end if
    	if strLink = "yes" then
          Response.Write("</a><br><br>" & vbCrLf)
    	end if
        'set oChildNode = oNode.selectSingleNode("description")
        'if not oChildNode is nothing then
        '  Response.Write("  " & oChildNode.text & "<br/>" & vbCrLf)
        'end if
    	'if i > 7 then exit for
    	i = i + 1
        Response.Write("</div>" & vbCrLf)
      next
    else
      Response.Write(strPANError & vbCrLf)
    end if
    %>
    
    Code (markup):
     
    ludwig, Jul 7, 2006 IP
  6. YIAM

    YIAM Notable Member

    Messages:
    2,480
    Likes Received:
    240
    Best Answers:
    0
    Trophy Points:
    280
    #6
    Nice Script but not working with the bloggers atom feed. Can some let me know how to do it.
     
    YIAM, Oct 25, 2006 IP
  7. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #7
    Maybe you need to modify it a bit? have you tried, or you just changed the url.

    It has been working for me so far
     
    ludwig, Oct 25, 2006 IP