我的工作的一部分是在第三方游戏网站上注册几个新用户。
我希望在不打开浏览器的情况下重做脚本,但我不确定该使用什么,php with curl,JavaScript?
有没有什么好的建议和推荐信?我需要一些轻快的东西。任何帮助都是非常感谢的。
发布于 2015-04-11 16:33:08
我最近发表了一篇关于WinHttpRequest COM的文章,并解释了如何使用它进行登录:How to do logins using the WinHttpRequest COM?
如果您对目标站点进行了一点反向工程,则可以更改提供的代码,以便将注册所需的数据发送到服务器。
它可能看起来有点像这样:
;Prepare our WinHttpRequest object
HttpObj := ComObjCreate("WinHttp.WinHttpRequest.5.1")
;HttpObj.SetProxy(2,"localhost:8888") ;Send data through Fiddler (for debugging)
HttpObj.SetTimeouts(6000,6000,6000,6000) ;Set timeouts to 6 seconds
;HttpObj.Option(6) := False ;disable location-header rediects
;Set our URLs
registrationURL := "http://yoursite/registerOrWhatever/"
;Set our registration data
username := "Samah"
email := "myEmail@foo.bar"
password := "mySecretPassword"
acceptTOS := 1
receiveNewsLetter := 0
registrationBody := "username=" username "&email=" email "&repeatEmail=" email "&password=" password "&repeatPassword=" password "&TOSagree=" acceptTOS "&weeklyNewsLetter=" receiveNewsLetter
HttpObj.Open("POST",registrationURL)
HttpObj.SetRequestHeader("Content-Type","application/x-www-form-urlencoded")
HttpObj.Send(registrationBody)
If (HttpObj.status == 200 && InStr(HttpObj.ResponseText,"You will shortly receive an email with an activation link."))
MsgBox, User successfully registered.
Else
MsgBox, The registration failed!https://stackoverflow.com/questions/29574855
复制相似问题