Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old May 23rd, 2006, 04:15 PM
Guest
 
Posts: n/a
Default A weird one...

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/view_rss.php?type=js&source_id=22775&feed_width=20 0&frame_color=black&title_textcolor=black&title_bg color=white&box_textcolor=black&box_bgcolor=white& feed_showborder=0&feed_spacing=2&feed_align=left&f eed_textsize=12&feed_textfont=Times
New Roman,
serif&feed_maxitems=15&feed_desclimit=&feed_compac t=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.


  #2  
Old May 23rd, 2006, 09:05 PM
Mike Brind
Guest
 
Posts: n/a
Default Re: A weird one...


nospam@invalid.invalid wrote:[color=blue]
> 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/view_rss.php?type=js&source_id=22775&feed_width=20 0&frame_color=black&title_textcolor=black&title_bg color=white&box_textcolor=black&box_bgcolor=white& feed_showborder=0&feed_spacing=2&feed_align=left&f eed_textsize=12&feed_textfont=Times
> New Roman,
> serif&feed_maxitems=15&feed_desclimit=&feed_compac t=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.[/color]

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.

  #3  
Old May 24th, 2006, 03:15 PM
Guest
 
Posts: n/a
Default Re: A weird one...

Mike - you're a star. Thank you so very much. That worked brilliantly!
[color=blue]
> 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:[/color]

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.


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,338 network members.