Skip to content

Instantly share code, notes, and snippets.

@nghiahsgs
Created May 1, 2020 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nghiahsgs/15b7c9e69f9823b0702c91db373cc0eb to your computer and use it in GitHub Desktop.
Save nghiahsgs/15b7c9e69f9823b0702c91db373cc0eb to your computer and use it in GitHub Desktop.
#include<Array.au3>
;~ #include<utils.au3>
#include<_HttpRequest.au3>
$add='Referer: http://simthue.com/vi/request/index'
$add&='|User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36'
$add&='X-Requested-With: XMLHttpRequest'
;~ ;cookie of account in web simthue
;~ $cookie_simthue='_language=43aebd2cff0d4b944fa62f01bf1eacf563456184c582230bb2ac2a8f264f187aa%3A2%3A%7Bi%3A0%3Bs%3A9%3A%22_language%22%3Bi%3A1%3Bs%3A2%3A%22vi%22%3B%7D; authen_key=f164bf259e35ff67e61966537768aaa1473559930384a09307bf87f44e97f6d3a%3A2%3A%7Bi%3A0%3Bs%3A10%3A%22authen_key%22%3Bi%3A1%3Bs%3A32%3A%22c505a6048231d38719a562ded8f4502b%22%3B%7D; seller_id=d30e62a02ba8da31e60b78372801e0a02350691e59c7da1b747dd180b118b78fa%3A2%3A%7Bi%3A0%3Bs%3A9%3A%22seller_id%22%3Bi%3A1%3Bi%3A1%3B%7D; _csrf=8e0e78ffcbeab95a0dcdf4ba4854308490056a9e771115474bdb3b9f039d7e0ba%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%22f7jV4Puf0poMsaRnck-hcMeKHyD3U8xU%22%3B%7D; __favoriteServiceId=29; PHPFRONTSESSID=033lioa9h9em9al2s0atb5nvn4'
;========CREATE SIM ====
Func create_sim($cookie_simthue)
$cookie=$cookie_simthue
$dataPost='service=29'
$url='http://simthue.com/vi/request/create'
$data=_HttpRequest(2,$url,$dataPost,$cookie,'',$add)
If StringReplace($data,'success','') <>$data Then
Sleep(7000) ;wait server response phone
return True
Else
return False
EndIf
EndFunc
;~ MsgBox(0,0,create_sim())
;========CHECK NEWEST PHONE ====
Func check_info_newest_phone($cookie_simthue)
$cookie=$cookie_simthue
;~ _HttpRequest_NewSession
$url='http://simthue.com/vi/request/list?page=1&status=all'
$data=_HttpRequest(2,$url,'',$cookie,'',$add)
;~ MsgBox(0,0,$data)
Dim $result[4]=['','','','']
$newest_uuid=regex_one_value($data,'"uuid":"(.*?)"')
;~ MsgBox(0,0,$newest_uuid)
$result[0]=$newest_uuid
$newest_sim_id=regex_one_value($data,'sim_id":"(.*?)"')
$newest_sim_id=StringReplace($newest_sim_id,'84','')
$x=StringSplit($newest_sim_id,'')
if IsArray($x) Then
$newest_sim_id=$x[1]&$x[2]&$x[3]&' '&$x[4]&$x[5]&$x[6]&' '&$x[7]&$x[8]&$x[9]
EndIf
;~ MsgBox(0,0,$newest_sim_id)
$result[1]=$newest_sim_id
$newest_sms_count=regex_one_value($data,'"total_sms_count":"(.*?)"')
;~ MsgBox(0,0,$newest_sms_count)
$result[2]=$newest_sms_count
$newest_status=regex_one_value($data,'"status":"(.*?)"')
;~ MsgBox(0,0,$newest_status)
$result[3]=$newest_status ; 5 => error wait sms
return $result
EndFunc
;~ _ArrayDisplay(check_info_newest_phone($cookie_simthue))
;~ _ArrayDisplay(check_info_newest_phone($cookie_simthue))
;========READ SMS OF SPECIFIC UUID ====
Func read_sms_code($cookie_simthue,$uuid)
$cookie=$cookie_simthue
$url='http://simthue.com/vi/request/detail?id='&$uuid
$data=_HttpRequest(2,$url,'',$cookie)
;~ MsgBox(0,0,$data)
$sms=StringRegExp($data,'"status":"sms:(.*?)"',1)[0]
;~ MsgBox(0,0,$sms)
$array_sms=StringSplit($sms,'|')
$timestamp=$array_sms[1]
$content_sms=$array_sms[3]
$sms_code=regex_one_value($content_sms,'[0-9]+')
return $sms_code
EndFunc
;~ $uuid='RgsRdCEluTI9'
;~ MsgBox(0,0,read_sms_code($uuid))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment