Great! Thanks works. Now I get past the browser check.
I seem to be having problems logging in though. I get the cookie, but I seem to end back at the login screen. Heres my code:
alias fb.login {
sockclose fb.login
unset %fb.cookie
sockopen -e fb.login login.facebook.com 443
}
on *:sockopen:fb.login:{
if (!$sockerr) {
var %fb.login = $+(email=me@gmail.com,$chr(38),pass=mypass,$chr(38),persistent=1)
//echo 4 -a %fb.login
sockwrite -nt $sockname POST /login.php HTTP/1.1
sockwrite -nt $sockname Host: login.facebook.com
sockwrite -nt $sockname User-agent: Opera/9.00 (Windows NT 4.0; U; en)
sockwrite -nt $sockname Content-Type: application/x-www-form-urlencoded
sockwrite -nt $sockname Content-Length: $len(%fb.login)
; sockwrite -nt $sockname Connection: Keep-Alive
sockwrite -nt $sockname
sockwrite -nt $sockname %fb.login
}
else { //echo -a sockerr }
}
on *:sockread:fb.login:{
sockread %temp
//echo -a Out: %temp
if ($fb.cookie(%temp)) { tokenize 61 $v1 | hadd -m TB.hfs.cookie $1 $2 }
}
alias fb.cookie {
var %r $regex($1-,/Set-Cookie:([^;]+)|$)/U)
return $regml(1)
}
...and heres the output:
Out: HTTP/1.1 200 OK
Out: Date: Sun, 23 Mar 2008 07:17:11 GMT
Out: Server: Apache/1.3.37.fb1
Out: Expires: Mon, 26 Jul 1997 05:00:00 GMT
Out: Cache-Control: private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Out: Pragma: no-cache
Out: P3P: CP="HONK"
Out: Set-Cookie: datr=ab0b5084325b9c190859d42801e2666643843c16938855febdd0125ef7bc919c; expires=Tue, 22-Apr-2008 07:17:11 GMT; path=/; domain=.facebook.com; httponly
Out: Set-Cookie: test_cookie=1; path=/; domain=.facebook.com; httponly
Out: Set-Cookie: login=+; path=/; domain=.facebook.com; httponly
Out: Set-Cookie: login_x=me%40gmail.com; expires=Thu, 17-Jul-2008 01:03:51 GMT; path=/; domain=.facebook.com; httponly
Out: Set-Cookie: reg_fb_gate=https%3A%2F%2Flogin.facebook.com%2Flogin.php; path=/; domain=.facebook.com; httponly
Out: Set-Cookie: reg_fb_ref=https%3A%2F%2Flogin.facebook.com%2Flogin.php; path=/; domain=.facebook.com; httponly
Out: Transfer-Encoding: chunked
Out: Content-Type: text/html; charset=utf-8
Out:
Out: 1c4b
Out: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
Out: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Out: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" id="facebook">
Out: <head>
Out: <title>Login | Facebook</title>
Out: <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
I truncated the output. Some lines are too long, and its pretty much just the login/registration form.
Can anyone see why its not logging in? I can log in from firefox, so its not account problem.