A weird one...

G

Guest

I need to download an rss feed on a regular basis that is embedded only in
javascript (external website) and store it on my webserver's hard drive
someplace. The code goes like this:

<script language="javascript" type="text/javascript"
src="http://www.feedroll.com/rssviewer/v...ign=left&feed_textsize=12&feed_textfont=Times
New Roman,
serif&feed_maxitems=15&feed_desclimit=&feed_compact=1&feed_xmlbutton=0&link_openblank=1"></script>

How do I get my webserver to automatically download that output into a file
that I can then refer to in another piece of code at a later date? (I intend
to try and get the file downloaded on a rolling basis throughout the day
without having to download the output myself).

Any ideas how this can be done? Someone mentioned a little while ago that I
could put the "code" in a vbscript file and fire it on a schedule within
windows, but I've been scratching my head how to get the http data streaming
back into something resembling an include file! (I'm a newbie at vbscript).

Thanks for any help.
 
M

Mike Brind

I need to download an rss feed on a regular basis that is embedded only in
javascript (external website) and store it on my webserver's hard drive
someplace. The code goes like this:

<script language="javascript" type="text/javascript"
src="http://www.feedroll.com/rssviewer/v...ign=left&feed_textsize=12&feed_textfont=Times
New Roman,
serif&feed_maxitems=15&feed_desclimit=&feed_compact=1&feed_xmlbutton=0&link_openblank=1"></script>

How do I get my webserver to automatically download that output into a file
that I can then refer to in another piece of code at a later date? (I intend
to try and get the file downloaded on a rolling basis throughout the day
without having to download the output myself).

Any ideas how this can be done? Someone mentioned a little while ago that I
could put the "code" in a vbscript file and fire it on a schedule within
windows, but I've been scratching my head how to get the http data streaming
back into something resembling an include file! (I'm a newbie at vbscript).

Thanks for any help.

I can't quite understand why you would want to store an rss feed for
use at a later date (when it would by definition be out of date), but
here's how to get hold of it:

<%
Dim url, xmlhttp
url =
"http://www.feedroll.com/rssviewer/view_rss.php?type=js&source_id=22775"

set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.open "GET", url, false
xmlhttp.send ""
ResponseWrite "<Script language=""javascript"">" & xmlhttp.ResponseText
& "</script>"
set xmlhttp = nothing
%>

If you want to write it to a file, use the Scripting.FileSystemObject -
http://www.aspfaq.com/show.asp?id=2039 - to write the
xmlhttp.ResponseText to a file.

For ideas on a number of ways to schedule the collection of the feed:
http://www.aspfaq.com/show.asp?id=2143

--
Mike Brind




That will write the contents of the feed to your page.
 
G

Guest

Mike - you're a star. Thank you so very much. That worked brilliantly!
I can't quite understand why you would want to store an rss feed for
use at a later date (when it would by definition be out of date), but
here's how to get hold of it:

The reason why I'd decided to temporarily archive a RSS, is that the page I
used it for downloads 4 RSS feeds at the same time which significantly slows
the loading of the homepage, which in my opinion isn't very user friendly.

So, I decided it would be good to only load the fresh content for a few
minutes each hour and then refer to a local "archived" copy which is less
than an hour old. That way, my users don't hit the remote RSS server so
often, the traffic on our network (intranet LAN) isn't so high and the
content is served up from a local folder rather than a remote one, which has
given the speed advantage I was looking to gain.

Cheers again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,818
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top