|
|
|
|
|
|
| |

A Better World
By Design |
| |
|
|
|
AaronOutpost : ASP /
Tutorials /
Web Fetching XMLHTTP |
|
|
Aaron's Web Fetching XMLHTTP
By: Aaron B. Copyright AaronOutpost.com
This is a XMLHTTP Function to get
the HTML coding a specified webpage and then display it on your site. So, if the
page you request have images on it and you don't have the same images in a
directory on your site they will not be listed. If you want, you can save the
data into a database and process it and strip other data if you want to extract
what you want.
BE AWARE!!! You
need to make sure you have permission to take information from another site!
<%
'----------------------------------------------------------------------------
'This Function by
AaronOutpost.com to fetch a URL and display it
'----------------------------------------------------------------------------
Function fetch_url (strURL)
On Error Resume Next
set XMLHTTP_AARON = Server.CreateObject ("Microsoft.XMLHTTP")
XMLHTTP_AARON.Open "GET", strURL ,False,"",""
XMLHTTP_AARON.Send
If Err.Number = 0 Then
If XMLHTTP_AARON.status = 200 Then
fetch_url = XMLHTTP_AARON.responsetext
Else
fetch_url = "Bad URL"
End If
Else
fetch_url = Err.Description
End If
set XMLHTTP_AARON = nothing
end Function
' call the Function to
write url results
response.write fetch_url ("http://www.aaronoutpost.com")
%> |
|
|
AaronOutpost : ASP /
Tutorials /
Web Fetching XMLHTTP |
|