added urldownloadtovar lib
parent
9dda0e54f0
commit
529d033c80
@ -0,0 +1,61 @@
|
|||||||
|
;---ENVIRONMENT---------------------------------------------------------------------
|
||||||
|
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
|
||||||
|
;#Warn ; Enable warnings to assist with detecting common errors.
|
||||||
|
;DetectHiddenWindows, On
|
||||||
|
#SingleInstance, Force
|
||||||
|
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
|
||||||
|
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
|
||||||
|
;SetKeyDelay, 500
|
||||||
|
CoordMode, ToolTip, Screen
|
||||||
|
CoordMode, Mouse, Screen
|
||||||
|
;#NoTrayIcon
|
||||||
|
;Menu, Tray, Icon, ..\Icons\ICONNAMEHERE
|
||||||
|
|
||||||
|
;---Notes/Extra Info/#Includes------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
;---VARIABLES-----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
;---MAIN SCRIPT---------------------------------------------------------------------
|
||||||
|
/*
|
||||||
|
; Example Code:
|
||||||
|
#include URLDownloadToVar.ahk
|
||||||
|
URL = https://www.bitchute.com/video/WdxitRyWLZQ/
|
||||||
|
URLContents := URLDownloadToVar(URL)
|
||||||
|
TextFileName := yyyy . MM . dd . "_URLToVarDownload"
|
||||||
|
FileAppend, URLContents, %A_ScriptDir%/%TextFileName%.txt
|
||||||
|
run, %A_ScriptDir%/%TextFileName%.txt
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
; Example 2
|
||||||
|
#SingleInstance,Force
|
||||||
|
url=https://api.coindesk.com/v1/bpi/currentprice.json ; Plce URL here
|
||||||
|
Gui,Add,Edit,w800 h500,% URLDownloadToVar(url)
|
||||||
|
Gui,show,
|
||||||
|
return
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
; Example 2
|
||||||
|
/*#SingleInstance,Force
|
||||||
|
url=https://fdrpodcasts.com/api/?method=QueryPodcasts&keyword=4500 ; Plce URL here
|
||||||
|
url := URLDownloadToVar(url)
|
||||||
|
url := StrReplace(URL, "\/", "/")
|
||||||
|
|
||||||
|
Msgbox % "url: " url
|
||||||
|
|
||||||
|
Gui,Add,Edit,w800 h500,% URLDownloadToVar(url)
|
||||||
|
Gui,show,
|
||||||
|
return
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
URLDownloadToVar(url){
|
||||||
|
hObject:=ComObjCreate("WinHttp.WinHttpRequest.5.1")
|
||||||
|
hObject.Open("GET",url)
|
||||||
|
hObject.Send()
|
||||||
|
return hObject.ResponseText
|
||||||
|
}
|
Loading…
Reference in New Issue