Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Viewing Yahoo rss on website
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Astralis
Senior Member

USA
1218 Posts

Posted - 30 November 2004 :  17:12:21  Show Profile  Send Astralis a Yahoo! Message
Does anyone have code to share to be able to place and read the Yahoo RSS news feeds on a website?

Astralis
Senior Member

USA
1218 Posts

Posted - 30 November 2004 :  17:54:20  Show Profile  Send Astralis a Yahoo! Message
I was using the following script but it locked up my site. I deleted it and the site runs normal now. Any recommendations?


<%
Function getXML(sourceFile) 
dim styleFile 
dim source, style 
styleFile = Server.MapPath("news.xsl")

Dim xmlhttp
Set xmlhttp = Server.CreateObject("Microsoft.XMLHTTP")
xmlhttp.Open "GET", sourceFile, false
xmlhttp.Send

set source = Server.CreateObject("Microsoft.XMLDOM")
source.async = false 
source.loadxml(xmlhttp.ResponseText) 

set style = Server.CreateObject("Microsoft.XMLDOM")
style.async = false 
style.load(styleFile) 

getXML = source.transformNode(style) 
set source = nothing 
set style = nothing 
End Function 
%>




<%= getXML("http://news.search.yahoo.com/news/rss?p=message+boards&ei=UTF-8&fl=0&x=wrt") %>


News.xsl

<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="*">
<table border="0" width="100%" align="center" cellpadding="4" cellspacing="1">
<tr><td valign="top" align="center" class="title" bgcolor="silver" >
<a>
<xsl:attribute name="href">
<xsl:value-of select="*[local-name()='channel']/*[local-name()='link']"/>
</xsl:attribute>
<xsl:attribute name="target">
<xsl:text>top</xsl:text>
</xsl:attribute>
<xsl:value-of select="*[local-name()='channel']/*[local-name()='title']"/>
</a>
<xsl:text disable-output-escaping="yes"> </xsl:text>
<xsl:value-of select="*[local-name()='channel']/*[local-name()='lastBuildDate']"/>
</td></tr><tr><td valign="top" bgcolor="ghostwhite" class="headlines" >
<ul>
<xsl:for-each select="//*[local-name()='item']">
<li>
<a>
<xsl:attribute name="href">
<xsl:value-of select="*[local-name()='link']"/>
</xsl:attribute>
<xsl:attribute name="target">
<xsl:text>top</xsl:text>
</xsl:attribute>
<xsl:value-of select="*[local-name()='title']"/>
</a>
<xsl:value-of select="*[local-name()='description']" disable-output-escaping="yes"/>
</li>
</xsl:for-each>
</ul>
</td></tr>
</table>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>

Edited by - Astralis on 30 November 2004 19:26:29
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 02 December 2004 :  23:49:35  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Here is a GREAT ASP Rss Feed Class to use...

http://www.tele-pro.co.uk/scripts/rss/

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.28 seconds. Powered By: Snitz Forums 2000 Version 3.4.07