Forum Moderators: open

Message Too Old, No Replies

WebmasterWorld RSS Feed ASP/VB Script

Anyone got a snippet of code for this?

         

CustomFit

10:47 pm on May 15, 2003 (gmt 0)

10+ Year Member



Does anyone have some cut and paste ASP/VB script that'll work for Webmasterworld's RSS newsfeed, along with the code for the .xml file?

Thanks in advance.

jatar_k

11:53 pm on May 15, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



hotscripts.com seems to have an ASP XML Parser Component that may do the trick but the site seems to be presently unavailable (at least for me) so you may have to wait a bit.

<added>oops, where are my manners

Welcome to WebmasterWorld CustomFit :)

Xoc

6:02 am on May 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use this:

<%=CreateHTMLFromXMLXSL("http://www.webmasterworld.com/index.rss", Server.MapPath("webmasterworldheadlines.xsl"), array("date",Left(RFC1123Date(date),16)))%>

Click here [xoc.net] for the function in VBScript.

This is the xsl style sheet:


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" standalone="no"/>

<xsl:param name="date"/>

<xsl:template match="rss">
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="child::channel">
<div style="BORDER-RIGHT: gray thin solid;BORDER-TOP: gray thin solid;BORDER-LEFT: gray thin solid;BORDER-BOTTOM: gray thin solid">
<span class="heading">Selected threads from <a href="http://www.webmasterworld.com">WebmasterWorld.Com</a></span><br />
<span class="tiny">For <xsl:value-of select="$date"/></span>
<ul>
<xsl:apply-templates/>
<li><a href="http://www.webmasterworld.com/library.cgi?sortby=Date-Last-Post&amp;sortdir=rvs&amp;ashow=100">More threads...</a></li>
</ul>
</div>
</xsl:template>

<xsl:template match="child::item">
<li><a href="{child::link}" title="{child::description}"><xsl:value-of select="child::title"/></a></li>
</xsl:template>

<xsl:template match="child::*"/>
</xsl:stylesheet>

and this is the other function:


Function RFC1123Date(dateSpec)
Dim astrDay
Dim astrNum
Dim astrMonth

astrDay = Array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat")
astrNum = Array( "00", _
"01", "02", "03", "04", "05", "06", "07", "08", "09", "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")
astrMonth = Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", _
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
RFC1123Date = astrDay(WeekDay(dateSpec) - 1) & ", " & astrNum(Day(dateSpec)) _
& " " & astrMonth(Month(dateSpec) - 1) & " " & Year(dateSpec) _
& " " & astrNum(Hour(dateSpec)) & ":" & astrNum(Minute(dateSpec)) _
& ":" & astrNum(Second(dateSpec)) & " " & Application("TimeZone")
End Function