Global $__g_oHttp = ObjCreate('WinHttp.WinHttpRequest.5.1')
; ---
ConsoleWrite(_Get('http://goo.gl/XWyRSq') & @CRLF)
Func _Get($sUrl, $sRef = '')
Local $sLoc
; ---
With $__g_oHttp
.Open('GET', $sUrl, 0)
.SetRequestHeader('Referer', $sRef)
.Option(6) = 0
.Send()
; *
$sLoc = Execute('.GetResponseHeader("Location")')
EndWith
If $sLoc Then _
Return _Get($sLoc, $sUrl)
Return $sUrl
EndFunc