Blogs, Tagging, RSS Feeds
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   SEO Chat ForumsSearch Engine StrategiesBlogs, Tagging, RSS Feeds

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread SEO Chat Forums Sponsor:
  #1  
Old April 30th, 2006, 09:54 AM
Market-Trend Market-Trend is offline
Contributing User
SEO Chat Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 178 Market-Trend User rank is Private First Class (20 - 50 Reputation Level)Market-Trend User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 7 h 9 m 54 sec
Reputation Power: 5
Publish RSS feed into a .NET aspx file

Hi

I want to publish this feed:

http://blog.holidaycottagescornwall.com/?feed=rss2

Into a .aspx file, I normally use the following code on a normal windows hosting server:

<%
Response.Expires = -1

URLToRSS = "http://blog.holidaycottagescornwall.com/?feed=rss2"


MaxNumberOfItems = 7


MainTemplateHeader = "<table>"
MainTemplateFooter = "</table>"
temTemplate = "<tr><td><a href=" & """{LINK}""" & " target=" & chr(34) & "_blank" & chr(34) & ">{TITLE}</a><BR>{DESCRIPTION}</td></tr>"




ErrorMessage = "Error has occured while trying to process " &URLToRSS & "<BR>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.LoadXml(RSSXML)

Set xmlHttp = Nothing ' clear HTTP object

Set RSSItems = xmlDOM.getElementsByTagName("item") ' collect all "items" from downloaded RSS
Set xmlDOM = Nothing ' clear XML

RSSItemsCount = RSSItems.Length-1

if RSSItemsCount > 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"
RSSlink = child.text
case "description"
RSSdescription = child.text
End Select
next

If (InStr(RSSTitle,Keyword1)>0) or (InStr(RSSTitle,Keyword2)>0) or (InStr(RSSDescription,Keyword1)>0) or (InStr(RSSDescription,Keyword2)>0) then

j = J+1

if J<MaxNumberOfItems then
ItemContent = Replace(ItemTemplate,"{LINK}",RSSlink)
ItemContent = Replace(ItemContent,"{TITLE}",RSSTitle)
Response.Write Replace(ItemContent,"{DESCRIPTION}",RSSDescription)
ItemContent = ""
End if
End If

Next

if RSSItemsCount > 0 then
Response.Write MainTemplateFooter
else
Response.Write ErrorMessage
End If

%>


Which normally works fine but it doesnt compile on a .NET server, does anyone know how I can publish this feed into a .aspx page ?

Cheers.

Reply With Quote
Reply

Viewing: SEO Chat ForumsSearch Engine StrategiesBlogs, Tagging, RSS Feeds > Publish RSS feed into a .NET aspx file


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT