/ Published in: ASP
URL: http://reusablecode.blogspot.com/2009/04/homeland-security-advisory-system.html
Returns the current national threat level as a string.
Expand |
Embed | Plain Text
<% ' Copyright (c) 2009, reusablecode.blogspot.com; some rights reserved. ' ' This work is licensed under the Creative Commons Attribution License. To view ' a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or ' send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California ' 94305, USA. ' Obtain the current Department of Homeland Security threat level. function getThreatLevel() dim regEx set regEx = new RegExp with regEx .Pattern = ".*\n.*CONDITION=""(.*)"" />" .IgnoreCase = true .Global = true end with dim xmlhttp set xmlhttp = Server.CreateObject("Msxml2.ServerXMLHTTP") xmlhttp.open "GET", "http://www.dhs.gov/dhspublic/getAdvisoryCondition", "False" xmlhttp.send getThreatLevel = regEx.replace(xmlhttp.responseText, "$1") set xmlhttp = nothing set regEx = nothing end function %>
You need to login to post a comment.
