var email = "youremail"; var password = "yourpassword"; var BASE_URL = "https://api.facebook.com/restserver.php"; var API_SECRET = "c1e620fa708a1d5696fb991c1bde5662"; var md5 = function(d){result = M(V(Y(X(d),8*d.length)));return result.toLowerCase()};function M(d){for(var _,m="0123456789ABCDEF",f="",r=0;r>>4&15)+m.charAt(15&_);return f}function X(d){for(var _=Array(d.length>>2),m=0;m<_.length;m++)_[m]=0;for(m=0;m<8*d.length;m+=8)_[m>>5]|=(255&d.charCodeAt(m/8))<>5]>>>m%32&255);return _}function Y(d,_){d[_>>5]|=128<<_%32,d[14+(_+64>>>9<<4)]=_;for(var m=1732584193,f=-271733879,r=-1732584194,i=271733878,n=0;n>16)+(_>>16)+(m>>16)<<16|65535&m}function bit_rol(d,_){return d<<_|d>>>32-_}; var data = { "api_key": "3e7c78e35a76a9299309885393b02d97", "email": email, "format": "JSON", "locale": "vi_vn", "method": "auth.login", "password": password, "return_ssl_resources": 0, "v": "1.0" }; var str = ""; for (var key in data){ if (data.hasOwnProperty(key)) { str += key + "=" + data[key]; } } str += API_SECRET; var sig = md5(str); data["sig"] = sig; var params = ""; for (var key in data){ if (data.hasOwnProperty(key)) { params += "&" + key + "=" + data[key]; } } var url = BASE_URL + "?" + params; var win = window.open(url, '_blank'); win.focus();