Created
April 22, 2021 21:27
-
-
Save JoeGlines/e8fad53cd0e89843565da443b59ca4d0 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 | |
;******************************************************* | |
;~ https://www.reddit.com/r/AutoHotkey/top/.xml?count=20 | |
EndPoint:="https://www.reddit.com/r/AutoHotkey/top/.xml" | |
QueryString:=QueryString_Builder({"count":"20"}) | |
;~ MsgBox % QueryString | |
;***********API call******************* | |
http:= ComObjCreate("WinHttp.WinHttpRequest.5.1") | |
http.Open("GET",EndPoint . QueryString) | |
HTTP.SetRequestHeader("accept","text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8") | |
HTTP.SetRequestHeader("Accept-Encoding", "gzip,deflate,sdch") ;sdch is Google Shared Dictionary Compression for HTTP | |
HTTP.SetRequestHeader("User-Agent","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.40 Safari/537.36") | |
HTTP.SetRequestHeader("Cookie", "reddit_session=38800806%2C2016-09-09T03%3A57%3A44%2Ca42aa9c84f0e5593d7ab3a5c9eadda53d524f367; secure_session=1; _recent_srs=t5_2rodl%2Ct5_3fih6; loid=0000000000000n3mw6.2.1429884359891.Z0FBQUFBQlpSblVqZG9ZTC1TUXlRa09oOWpaSk15THVfX3hUNzd0VGRtTkhYQlY4MURRQU95OXJUT0xocmVNdXBnak9xeUF0NERvYkFENnk5TFRFYmRlS055aThrV3Qwa05tN2k2a2lZS3pXTTRjcFFFOGk5U0ZlTWZMN1phd3pBMDFQQjF0RHpDN20; loid_old=IMXIEZOtTblUWbNr5Z; edgebucket=RCDVR90bTmS8Z00rQO; joetazz_recentclicks2=t3_2c2ktw%2C; joetazz_recent_srs=t5_2qizd%2Ct5_2rodl%2Ct5_3fih6%2Ct5_34em3; pc=fj; session_tracker=K0KAEeutMKNQ4Qw5Sw.0.1498341387189.Z0FBQUFBQlpUdUFMUjd6cllHNUM0YWdBN2lUbWNCVFVyT2d6d2xFVmQyby1PWXl5b3pUMXhuTTQyU3YzRGVPNXpxeHVoSXA4MVZUU1d2R0NsQ0tUeGo5N2pmcVFvdk9xT1B1RXg1TjlYRTl5Rl80T05BV0l6elNfOEFveExabHhlY3FXR3I4S2lGZHI; initref=google.com") | |
http.Send() | |
;~ SciTE_Output(http.Responsetext) ;Text,Clear=1,LineBreak=1,Exit=0 | |
SciTE_Output(sXML_Pretty(http.Responsetext," ")) | |
;Text,Clear=1,LineBreak=1,Exit=0 | |
;************Query String builders********* | |
QueryString_Builder(x){ | |
for a,b in x | |
String.=(A_Index=1?"?":"&") a "=" b | |
return String | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment