RSS FEED

R

rfr

I have wondered the same thing too. It seems to me that either there has to
be some software on your server that is evoked by some coding in your HTML
document, OR the visitor will have to have some software loaded on his
system, like is necessary to read PDF files, or FLASH modules.

It would seem logical, and quite useful to me, is that there should be a
plug-in for FrontPage webs that we could publish to the server and be
invoked to handle any RSS feeds we place in our HTML documents. We include
JavaScript modules in our webs and evoke them in our documents. Why cannot
we have RSS support that we can evoke in our documents too?

But, I dont know how to do this. I wish I did.

It, also, seems to me that RSS could be a method for me to distribute the
community information that I have on my community website in a way that
other web sites could be displaying the information too.

But, at this point in time, I am wondering how to do this, as you are
wondering how to do this.
 
N

Nicholas Savalas - http://savalas.tv

Dear Yurol,
Assuming you are running on an IIS Server (Windows Server 2000 and
above), including an RSS feed on your site is as simple as pie.
Here is the code for a new page you must create - the RSS feed
"gatherer" page (save it as, say, inc_rss.asp):
------------------------------

<%
Response.Expires = -1

FEEDSRC_RSS = "http://example.com/rss.xml" 'feed location

MaxNumberOfItems = 10 'number of feed entries to show

MainTemplateHeader = "<table>"
MainTemplateFooter = "</table>"

Keyword1 = "" 'keywords from feed
Keyword2 = ""

ItemTemplate = "<tr><td><a target=blank href=" & """{LINK}""" &
">{TITLE}</a><BR>{DESCRIPTION}</td></tr>"

ErrorMessage = "Data error from feed: " &FEEDSRC_RSS & "<BR><a
href=""mailto:[email protected]"">Please inform the webmaster.</a>"

Set xmlHttp = Server.CreateObject("MSXML2.XMLHTTP.3.0")
xmlHttp.Open "Get", FEEDSRC_RSS, false
xmlHttp.Send()
RSSXML = xmlHttp.ResponseText

Set xmlDOM = Server.CreateObject("MSXML2.DomDocument.3.0")
xmlDOM.async = false
xmlDOM.LoadXml(RSSXML)

Set xmlHttp = Nothing

Set RSSItems = xmlDOM.getElementsByTagName("item")
Set xmlDOM = Nothing

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

%>

--------------------------------
Remember to change every use of "example.com" above to the parameters
you want, and the FEEDSRC_RSS to the xml location. Save it as
inc_rss.asp - the last step is easy. Anywhere you want to display your
feed, just include this code:
<!--#include virtual="inc_rss.asp" --> like this:
---------------------------------

<html>
<head>
<title>My Feed</title>
</head>
<body>
<p>Here is a feed:</p>
<!--#include virtual="inc_rss.asp" -->
</body>
</html>

-----------------------------------------
Make sure that the page you use the feed on has an extension of
".asp", like default.asp - .htm extensions don't execute asp code. You
can rename any htm page to asp without problems on an IIS server. Good
luck, Yurol.

Nicholas Savalas - http://savalas.tv
 
N

Nicholas Savalas - http://savalas.tv

Dear Yurol,
There has been some discussion, in the past, as to whether or not the
example I presented actually functions. So, here, for the disbelieving,
is an example of the code i gave you at work (this is the LA Times
World feed - the link I took for this example is at:
http://www.latimes.com/services/sit...tmlstory?coll=la-navigation&track=leftnav-rss
) - here is the working example:

http://savalas.tv/modules/inc_rss_latimes_world.asp

Good luck, Yurol.

Nicholas Savalas - http://savalas.tv
 
Top