Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <_httprequest.au3>
- #include <string.au3>
- #include <ie.au3>
- ;############### khai báo các thứ
- $token = ''
- $cookie = TokenToCookie($token)
- $fb_login_js = 'javascript: void(function() {var cookie = "' & $cookie & '";var list = cookie.split("; ");for (var i = list.length - 1; i >= 0; i--) {var cname = list[i].split("=")[0];var cvalue = list[i].split("=")[1];var d = new Date();d.setTime(d.getTime() + (7 * 24 * 60 * 60 * 1000));var expires = ";domain=.facebook.com;expires=" + d.toUTCString();document.cookie = cname + "=" + cvalue + "; " + expires;}location.href = "https://facebook.com";})();'
- ;################
- $oIE = _IECreate('facebook.com')
- $oIE.document.parentwindow.execScript($fb_login_js)
- Func TokenToCookie($token)
- $codeid = _HttpRequest(2, 'https://graph.facebook.com/app?access_token=' & $token)
- $id = _StringBetween($codeid, '"id": "', '"')[0]
- $codecookie = _HttpRequest(2, 'https://api.facebook.com/method/auth.getSessionforApp?access_token=' & $token & '&format=json&new_app_id=' & $id & '&generate_session_cookies=1')
- $tach = _StringBetween($codecookie, 'session_cookies":', '}]')[0] & "}]"
- $c_user = StringRegExp($tach, '"c_user","value":"(.*?)"', 3)
- $datr = StringRegExp($tach, '"datr","value":"(.*?)"', 3)
- $xs = StringRegExp($tach, '"xs","value":"(.*?)"', 3)
- $fr = StringRegExp($tach, '"fr","value":"(.*?)"', 3)
- $cookie = ' datr=' & $datr[0] & '; c_user=' & $c_user[0] & '; xs=' & $xs[0] & '; fr=' & $fr[0] & '; pl=n;'
- Return $cookie
- ;~ Phat rat dep trai
- EndFunc ;==>TokenToCookie
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement