Created
March 10, 2023 16:21
-
-
Save JoeGlines/330b8e1b0556363540e0cb57b0fa0421 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
Gui, Submit ; Save the input from the user to each control's associated variable. | |
Filename:= (SubStr(filename,-3)=".ahk")?(SubStr(Filename,1,StrLen(Filename)-4)):Filename ;just in case they end it with .ahk | |
Body:=Jxon_Dump({content:Clipboard}) ;need to encode it | |
Data={"description": "%Descr%","public": true,"files": {"%FileName%.ahk": %Body%}} ;build data for post havnig double quotes | |
Obj:=ParseJSON(Send(Token,"https://api.github.com/gists","POST",Data)) ;make post and return information about it | |
Clipboard:="Use the following for a webpage post:`n<script src='https://gist.github.com/" GitName "/"(SubStr(obj.url,Instr(obj.url,"/",,0)+1))".js'></script>`n`nYou can get the code here: " obj.html_url | |
WinGetTitle, ActiveWindow , A ;Get active title |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment