Skip to content

Instantly share code, notes, and snippets.

@zeqk
Created October 13, 2020 19:32
Show Gist options
  • Save zeqk/a6d56206aaf936938efe79687f67a5fb to your computer and use it in GitHub Desktop.
Save zeqk/a6d56206aaf936938efe79687f67a5fb to your computer and use it in GitHub Desktop.
Classic ASP xmlhttp example
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><!DOCTYPE html>
<%
'----------
' This is an example of an old script I used to use to pull data from an internal web server
' and render it on a public-facing website.
'----------
Function getBBstatus()
Dim xmlhttp
Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.setTimeouts 30,500,1000,1000
xmlhttp.Open "GET", "http://c455.hfcc/bb.txt?" & time, false
On Error Resume Next
xmlhttp.Send
If Err.Number Then
getBBstatus = "Could Not Retrieve Big Brother Status"
Err.Clear
Else
getBBstatus = xmlhttp.ResponseText
End If
On Error Goto 0
Set xmlhttp = nothing
End Function
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>xmlhttp example</title>
</head>
<body>
<div class="bbstatus"><%=getBBstatus%></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment