- 120 名前:119 mailto:sage [2012/03/18(日) 22:44:29.01 ID:???]
- <!doctype html><html><head><script type="text/javascript">
function run() { var url = document.getElementById("url"); getLocation(url.value.split("\r\n")); } function getLocation(strURLs) { WinHttpRequestOption_EnableRedirects = 6; var strResult = ""; for(i = 0; i < strURLs.length; i++) { try { var WinHttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1"); WinHttpReq.Open("GET", strURLs[i], false); WinHttpReq.Option(WinHttpRequestOption_EnableRedirects) = false; WinHttpReq.Send(); var re = new RegExp("30[12]"); if(re.test(WinHttpReq.Status)) { strResult += WinHttpReq.GetResponseHeader("Location"); } strResult += "\r\n<br>"; } catch (objError) { strResult = objError + "\n" strResult += "WinHTTP returned error: " + (objError.number & 0xFFFF).toString() + "\n\n"; strResult += objError.description; } } clipboardData.setData("text", strResult.replace(/<br>/g, '')); document.getElementById("res").innerHTML = strResult; } </script></head><body><p><textarea id="url" cols="50" rows="15"></textarea><button onclick="run()">Run</button></p><pre id="res"></pre></body></html>
|

|