SHARE
TWEET

Untitled

a guest Oct 22nd, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   async function atmos() {
  2.     async function login() {
  3.       var cookie = '';
  4.       var ck = utils.createCookieStore();
  5.  
  6.       var pa = ['', 'c@suddenattack.ga', 'manko123', '0', '0'];
  7.       const params = new FormData();
  8.  
  9.       var response = await utils.request({
  10.         url: 'https://www.atmos-tokyo.com/customer/menu',
  11.         method: 'GET',
  12.         headers: {
  13.           'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36',
  14.           'Cookie': cookie,
  15.         },
  16.         data: '',
  17.       });
  18.       utils.updateCookieStore(ck, cookie, response);
  19.       cookie = ck.getAll();
  20.  
  21.  
  22.       console.log(response.body.includes('name="_token"'));
  23.       var doc = utils.str2doc(response.body);
  24.  
  25.       console.log(doc.querySelector('[name="_token"]'));
  26.  
  27.       var tokenElem = doc.querySelector('[name="_token"]'), token = '';
  28.       if(tokenElem !== null) {
  29.         var tmp = tokenElem.getAttribute('value');
  30.         token = tmp !== null ? tmp : '';
  31.       }
  32.        
  33.       pa[0] = token;
  34.  
  35.       params.append('_token', pa[0]); params.append('email', pa[1]);
  36.       params.append('password', pa[2]);
  37.       params.append('btn_login.x', pa[3]); params.append('btn_login.y', pa[4]);
  38.  
  39.       console.log(pa);
  40.      
  41.       var response = await utils.request({
  42.         url: 'https://www.atmos-tokyo.com/customer/menu',
  43.         method: 'GET',
  44.         headers: {
  45.           'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36',
  46.           'Cookie': cookie,
  47.         },
  48.         data: '',
  49.       });
  50.       utils.updateCookieStore(ck, cookie, response);
  51.       cookie = ck.getAll();
  52.  
  53.       var response = await utils.request({
  54.         url: 'https://www.atmos-tokyo.com/customer/login',
  55.         method: 'POST',
  56.         headers: {
  57.           'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36',
  58.           'cookie': cookie,
  59.           'content-type': 'multipart/form-data',
  60.         },
  61.         data: params,
  62.       });
  63.       utils.updateCookieStore(ck, cookie, response);
  64.       cookie = ck.getAll();
  65.  
  66.       // ログインできたので、https://www.atmos-tokyo.com/customer/menu に転送される
  67.       var response = await redirect(response, {
  68.         'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36',
  69.         'cookie': cookie,
  70.       });
  71.      
  72.       var W = $(utils.str2doc(response.body));
  73.      
  74.       console.log('your name: ' + W.find('.user-name').text()); // ユーザー名 なんかカードみたいな画面のテキストノードを抜き出す
  75.  
  76.       console.log(response, 483957495);
  77.       console.log('ログインしました。');
  78.  
  79.       return {
  80.         response: response,
  81.         cookie: cookie,
  82.         ck: ck,
  83.       }
  84.     }
  85.     async function observe() {
  86.  
  87.     }
  88.     async function purchase(o) {
  89.       var item_url = 'https://www.atmos-tokyo.com/items/ek4335';
  90.       item_url
  91.     }
  92.  
  93.     var retObj = await login();
  94.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top