Created
April 22, 2021 21:20
-
-
Save JoeGlines/61082c7d3f9c64aa15bb81fa3b2705c3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;******************************************************* | |
; Want a clear path for learning AutoHotkey; Take a look at our AutoHotkey Udemy courses. They're structured in a way to make learning AHK EASY | |
; Right now you can get a coupon code here: https://the-Automator.com/Learn | |
;******************************************************* | |
queryString:=QueryString_Builder({"q":"select * from local.search where zip='75019' and query='hot dogs'","format":"json"}) | |
;~ MsgBox % queryString | |
EndPoint:="https://query.yahooapis.com/v1/public/yql" | |
;***********API call******************* | |
HTTP := ComObjCreate("WinHttp.WinHttpRequest.5.1") | |
HTTP.Open("GET", EndPoint . queryString) ;GET or POST most common; Uppercase matters! | |
HTTP.Send() | |
Response_Data:=HTTP.ResponseText | |
SciTE_Output(Response_Data) ;Text,Clear=1,LineBreak=1,Exit=0 | |
;~ SciTE_Output(sXML_Pretty(Response_data," ")) ;Text,Clear=1,LineBreak=1,Exit=0 | |
return | |
QueryString_Builder(kvp){ | |
for key, value in kvp | |
queryString.=((A_Index="1")?(url "?"):("&")) key "=" value | |
return queryString | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment