Logging Into Facebook

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")

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")

@Shastri Haines , did you ever figure it out as you got no response in the forum? I’m struggling with the same, I’m trying to login into a webservice via my user id and password but it doesn’t work.

For Facebook, @Matthew Combatti offers a API Classes: https://forum.xojo.com/13254-facebook-api-classes-1-7

Hi @Sascha S , unfortunately I’m not logging into FB with my application, it’s just a normal webpage: http://v2.gedmatch.com/login1.php

I’m sending the email and password but get the return “Not logged in”. My guess is that is has something to do with cookies that I’m not reading in as my code:

HTTPSocket.GetHeaders ("http://v2.gedmatch.com/login1.php", 0) As InternetHeaders

doesn’t work (Error message is: “There is more than one item with this name and it’s not clear to which this refers”. I’ve tried:

Dim socket1 As New HTTPSocket socket1.GetHeaders ("http://v2.gedmatch.com/login1.php", 0) As InternetHeaders

before but ended up with the same error message. The help page is not very helpful (at least not for a user like me), especially when you take code over 1:1 and it gives a cryptic error message.

Any help is appreciated!