Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - saving an html page on my server in asp
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

saving an html page on my server in asp

 Post Reply Post Reply
Author
Nathan View Drop Down
Groupie
Groupie


Joined: 08 January 2002
Location: Greece
Status: Offline
Points: 160
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nathan Quote  Post ReplyReply Direct Link To This Post Topic: saving an html page on my server in asp
    Posted: 13 January 2004 at 5:50am

Is there anyway that I can write a script that will download an html page (not on my server), and then save it as a txt file on my server?

Thanks

Nathan

 



Edited by Nathan
Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post Posted: 13 January 2004 at 8:55am

You can use FSO (FileSystemObject) to save text files. http://www.w3schools.com/asp/asp_ref_file.asp

and...

How are you planning on getting the url for the remote html page?

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 13 January 2004 at 11:18am
You can use Microsoft XML HTTP (think its that) to download the file, do a search on the forum in the asp discussion. If you have no luck i've got an example somewhere.
Back to Top
Nathan View Drop Down
Groupie
Groupie


Joined: 08 January 2002
Location: Greece
Status: Offline
Points: 160
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nathan Quote  Post ReplyReply Direct Link To This Post Posted: 20 January 2004 at 6:57am

Sorry I was not very clear with what I am trying to do. The chat system I use is a JavaHosted one. I want to be able to show on each page of my site, who is currently chatting. By following this link, I can view who is chatting - (but of course this file is not on my server):

http://client1.sigmachat.com/scwho.pl?id=52241

I want to be able to save the results of the above link as a simple txt file for inclusion on each of my web site pages. The script would be executed everytime someone joins (or leaves) the chat room to update the txt file.

Any help would be very welcome.

Thanks

Nathan

Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 20 January 2004 at 2:18pm
You can use Microsoft's XMLHTTP component as mart suggested, here's some code:

<%
Set objXML = Server.CreateObject("Microsoft.XMLHTTP")
objXML.Open "GET", "http://client1.sigmachat.com/scwho.pl?id=52241", False
objXML.Send
%>
<html>
<head></head>
<body>
<table><tr><td><% = objXML.ResponseText %></td></tr></table>
</body>
</html>
<% Set objXML = Nothing %>

You should place the <% = objXML.ResponseText %> wherever you want that page to be shown on your site.

The right way would be to parse the HTML from that page and get just
the usernames.... Or at least strip off everything exept the body of the page.





Edited by fernan82
FeRnAN
Back to Top
Bluefrog View Drop Down
Senior Member
Senior Member


Joined: 23 October 2002
Location: Korea, South
Status: Offline
Points: 1701
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bluefrog Quote  Post ReplyReply Direct Link To This Post Posted: 21 January 2004 at 9:12am
There are other components to do the same thing as XMLHTTP. I suppose it depends on whether you need more functionality. Doesn't look like you do though.
Back to Top
Nathan View Drop Down
Groupie
Groupie


Joined: 08 January 2002
Location: Greece
Status: Offline
Points: 160
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nathan Quote  Post ReplyReply Direct Link To This Post Posted: 08 February 2004 at 1:07pm

Super! Thanks People - it works great - the beers are on me!

Have been fiddling with XML over the last few days. A little worrying really, some of the things you can do should be illegal!

How demanding is XML on the server though? I worry that this may put extra load - defeating the orignal reason for using it.

Nathan

Thanks to Sofri from the Agni Travel office for his help in debuggin my scripts.

www.agni.gr

 

 

 

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.