Hi,
I am trying to create a simple log-in to a website using the HTTPSecureSocket Class.
I am wondering how I go about doing this?
Here is what I have below:
[code] Dim form As Dictionary
Dim strHTML as String //
Dim Searcher as integer
Dim SearchResults as RegExMatch
Dim socket1 As HTTPSecureSocket
form = new Dictionary
socket1 = New HTTPSecureSocket
socket1.Secure = True
strHTML = socket1.Get(“https://m.facebook.com/”, 30)
textarea1.text = strHTML
msgbox “Get done”
form.value (“email”) = “email@email.com”
form.value (“password”) = “password123”
socket1.SetFormData(form)
socket1.Post(“https://m.facebook.com/login.php”)
strhtml = socket1.readall
Searcher = instr(strHTML, “logoutURL”)
if Searcher > 0 then
msgbox “Logged in!”
else
msgbox “Not Logged in!”
end if
TextArea1.text = strhtml[/code]
However, when logging into Facebook you need to provide a number of different strings which are generated upon visiting the login page. What I need to do is find the values for these strings. I used to do this on other languages with a simple code to find the text between two words.
i.e.
LSD=XXX&
The code would then be essentially
LSDString = FindBetween("LSD=","&")
LSDString = "XXX"
I am also having some trouble posting all the data with the dictionary, is there not a way to do a simple post request with the data you would like to send across?
i.e.
strHTML = socket1.Get("m.facebook.com"
strHTML = socket1.post("m.Facebook.com/login.php?","DATA I WANT TO SEND ACROSS")