Jump to content

Recommended Posts

Posted

How can I log in to Facebook with the following code?

Func FB_Login($Username, $Password)

    Local $msg, $Ret[3], $log1, $Check, $FB_dtsg
    While 1
        $msg = GUIGetMsg()

        $log1 = _HttpRequest(1, "https://www.facebook.com/login.php?login_attempt=1&lwv=110", "email=" & _URIEncode($Username) & "&pass=" & _URIEncode($Password), _GetCookie(_HttpRequest(1, "https://www.facebook.com", "Facebook")))
    $Check = StringRegExp($log1, "Set-Cookie: c_user=(.*?);", 3)
    If not IsArray($Check) Then Return SetError(1, 0, False)
    $Ret[0] = _GetCookie($log1)
    $Ret[1] = $Check[0]
    $FB_dtsg = StringRegExp(_HttpRequest(2, "https://www.facebook.com/profile.php?id=" & $Ret[1], "", $Ret[0]), '<input type="hidden" name="fb_dtsg" value="(.*?)" autocomplete="off" />', 3)
    If not IsArray($FB_dtsg) Then Return SetError(2, 0, False)
    $Ret[2] = $FB_dtsg[0]
    Return $Ret
    ;MsgBox(0,0,$Ret)

    WEnd

EndFunc

Help me please :'(

Posted
1 hour ago, ATIDeath said:

How can I log in to Facebook with the following code?

Func FB_Login($Username, $Password)

    Local $msg, $Ret[3], $log1, $Check, $FB_dtsg
    While 1
        $msg = GUIGetMsg()

        $log1 = _HttpRequest(1, "https://www.facebook.com/login.php?login_attempt=1&lwv=110", "email=" & _URIEncode($Username) & "&pass=" & _URIEncode($Password), _GetCookie(_HttpRequest(1, "https://www.facebook.com", "Facebook")))
    $Check = StringRegExp($log1, "Set-Cookie: c_user=(.*?);", 3)
    If not IsArray($Check) Then Return SetError(1, 0, False)
    $Ret[0] = _GetCookie($log1)
    $Ret[1] = $Check[0]
    $FB_dtsg = StringRegExp(_HttpRequest(2, "https://www.facebook.com/profile.php?id=" & $Ret[1], "", $Ret[0]), '<input type="hidden" name="fb_dtsg" value="(.*?)" autocomplete="off" />', 3)
    If not IsArray($FB_dtsg) Then Return SetError(2, 0, False)
    $Ret[2] = $FB_dtsg[0]
    Return $Ret
    ;MsgBox(0,0,$Ret)

    WEnd

EndFunc

Help me please :'(

#include<_HttpRequest.au3>
$shown = True
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Login", 363, 165, 192, 124)
GUISetFont(12, 400, 0, "Tahoma")
$Label1 = GUICtrlCreateLabel("Email Or Mobile", 10, 26, 120, 23)
$IpUser = GUICtrlCreateInput("", 140, 24, 210, 27)
GUICtrlSendMsg($IpUser, $EM_SETCUEBANNER, False, "Email Or Mobile")
$Label2 = GUICtrlCreateLabel("PassWord", 10, 64, 120, 23)
$IpPass = GUICtrlCreateInput("", 140, 62, 210, 27,$ES_PASSWORD)
GUICtrlSendMsg($IpPass, $EM_SETCUEBANNER, False, "PassWord")
$Checkbox1 = GUICtrlCreateCheckbox ( "Show PassWord",140, 90, 210, 27)
GUICtrlSetData(-1, "")
$Button1 = GUICtrlCreateButton("Button1", 128, 120, 113, 29)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        case $Button1
                     FB_Login(GUICtrlRead($Username), GUICtrlRead($Password))
        Case $Checkbox1
            $read = GUICtrlRead ($Password)
            GUICtrlDelete ($Password)
            If $shown Then
                $shown = False
                $Password = GUICtrlCreateInput($read, 132, 57, 209, 22, $GUI_SS_DEFAULT_INPUT)
            Else
                $shown = True
                $Password = GUICtrlCreateInput($read, 132, 57, 209, 22, $ES_PASSWORD)
            EndIf
    EndSwitch
WEnd

It does not work :sweating: . please help me...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...