<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1256">
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY><PRE>&lt;%
 Response.Expires = -1

 ' =========== RSS2HTML.ASP for ASP/ASP.NET ==========
 ' copyright 2005-2007 (c) www.Bytescout.com
 '  version 1.22, 25 April 2007 
 ' ===============================================
 ' ##############################################################
 ' ####### CHECK OUR COMMERCIAL PRODUCTS FOR ASP/ASP.NET: #######
 ' SWF Scout [ http://bytescout.com/swfscout.html ]- create, read, modify flash movies (SWF)
 ' PDFDoc Scout [ http://bytescout.com/pdfdocscout.html ]- generate PDF documents with security options (PDF)
 ' ##############################################################

 ' =========== configuration =====================
 ' ##### URL to RSS Feed to display #########
 URLToRSS = "http://bytescout.com/blog/feed"

 ' ##### max number of displayed items #####
 MaxNumberOfItems = 7

 ' ##### Main template constants
 MainTemplateHeader = "&lt;table&gt;"
 MainTemplateFooter = "&lt;/table&gt;"
 ' ##### 

' ######################################
 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 2nd keyword too
' #################################

 ' ##### Item template.
 ' ##### {LINK} will be replaced with item link
 ' ##### {TITLE} will be replaced with item title
 ' ##### {DESCRIPTION} will be replaced with item description
 ' ##### {DATE} will be replaced with item date and time
 ' ##### {COMMENTSLINK} will be replaced with link to comments (if you use RSS feed from blog)
 ' ##### {CATEGORY} will be replaced with item category
 ItemTemplate = "&lt;tr&gt;&lt;td&gt;&lt;strong&gt;{DATE}&lt;/strong&gt;&lt;br/&gt;&lt;strong&gt;{CATEGORY}&lt;br/&gt;&lt;/strong&gt;&lt;a href=" &amp; """{LINK}""" &amp; "&gt;{TITLE}&lt;/a&gt;&lt;BR&gt;{DESCRIPTION}&lt;/td&gt;&lt;/tr&gt;"

 ' ##### Error message that will be displayed if not items etc
 ErrorMessage = "Error has occured while trying to process " &amp;URLToRSS &amp; "&lt;BR&gt;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.validateOnParse = False
 xmlDom.resolveExternals = False

 If not xmlDOM.LoadXml(RSSXML) Then
     ErrorMessage = "Can not load XML:" &amp; vbCRLF &amp; xmlDOM.parseError.reason &amp; vbCRLF &amp; ErrorMessage
 End If 

 Set xmlHttp = Nothing ' clear HTTP object

 Set RSSItems = xmlDOM.getElementsByTagName("item") ' collect all "items" from downloaded RSS

 RSSItemsCount = RSSItems.Length-1

 ' if not &lt;item&gt;..&lt;/item&gt; entries, then try to get &lt;entry&gt;..&lt;/entry&gt;
 if RSSItemsCount = -1 Then 
 Set RSSItems = xmlDOM.getElementsByTagName("entry") ' collect all "entry" (atom format) from downloaded RSS
 RSSItemsCount = RSSItems.Length-1

 End If 

 Set xmlDOM = Nothing ' clear XML


 ' writing Header
 if RSSItemsCount &gt; 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"
	   If RSSLink = "" Then
		If child.Attributes.length&gt;0 Then
		 RSSLink = child.GetAttribute("href")
		 	 if (RSSLink &lt;&gt; "") Then
 			  if child.GetAttribute("rel") &lt;&gt; "alternate" Then
	   			 RSSLink = ""
			  End If
 	   		 End If
		End If ' if has attributes	   	
 		If RSSLink = "" Then
		 	RSSlink = child.text
	   	End If
	   End If
     case "description"
           RSSdescription = child.text
     case "content" ' atom format
           RSSdescription = child.text
     case "published"' atom format
           RSSDate = child.text
     case "pubdate"
           RSSDate = child.text
     case "comments"
           RSSCommentsLink = child.text
     case "category"
	  	Set CategoryItems = RSSItem.getElementsByTagName("category")
		RSSCategory = ""
	  		for each categoryitem in CategoryItems
           			if RSSCategory &lt;&gt; "" Then 
					RSSCategory = RSSCategory &amp; ", "
				End If
			
					RSSCategory = RSSCategory &amp; categoryitem.text
			Next
   End Select
  next

' now check filter
 If (InStr(RSSTitle,Keyword1)&gt;0) or (InStr(RSSTitle,Keyword2)&gt;0) or (InStr(RSSDescription,Keyword1)&gt;0) or (InStr(RSSDescription,Keyword2)&gt;0) then

  j = J+1

  if J&lt;MaxNumberOfItems then 
  ItemContent = Replace(ItemTemplate,"{LINK}",RSSlink)
  ItemContent = Replace(ItemContent,"{TITLE}",RSSTitle)
  ItemContent = Replace(ItemContent,"{DATE}",RSSDate)
  ItemContent = Replace(ItemContent,"{COMMENTSLINK}",RSSCommentsLink)
  ItemContent = Replace(ItemContent,"{CATEGORY}",RSSCategory)

  Response.Write Replace(ItemContent,"{DESCRIPTION}",RSSDescription)
  ItemContent = ""
  End if
End If 

 Next

 ' writing Footer
 if RSSItemsCount &gt; 0 then 
  Response.Write MainTemplateFooter
 else 
  Response.Write ErrorMessage
 End If

' Response.End ' uncomment this for use in on-the-fly output
%&gt;</PRE></BODY></HTML>
