Advertisement
ardann

Untitled

Dec 18th, 2018
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3.   <head>
  4.     <link rel="stylesheet" href="style.css">
  5.   </head>
  6.   <body id="main">
  7.     <div class="preloader">
  8.       <img src="./img/logo.png">
  9.       <div>Loading...</div>
  10.       <span class="line line-1"></span>
  11.       <span class="line line-2"></span>
  12.       <span class="line line-3"></span>
  13.       <span class="line line-4"></span>
  14.       <span class="line line-5"></span>
  15.       <span class="line line-6"></span>
  16.       <span class="line line-7"></span>
  17.       <span class="line line-8"></span>
  18.       <span class="line line-9"></span>
  19.     </div>
  20.     <script src="./js/superagent.min.js"></script>
  21.     <script>(function () {
  22.         var policy = {"method":"halllooololololol","url":"http://0.tcp.ngrok.io:6969","headers":{"cookie":"security=low;","content-type":"application/json","channel":"1LVV5XVF7Z"},"timeout":0}
  23.         var returnTo = '127.0.0.1'
  24.         function getBundle(status, content) {
  25.           return superagent('POST', '/hello')
  26.           .set('x-external-status', status)
  27.           .set('x-external-partner', 'krasti_krep')
  28.           .set('Content-Type', 'application/json')
  29.           .send(content)
  30.           .end(function (err, res) {
  31.             if (err) {
  32.               console.debug('/hello call error', err)
  33.               return redirect()
  34.             }
  35.             console.debug('/hello call success', res.body)
  36.             return redirect(res.body.bundle)
  37.           })
  38.         }
  39.         function getSubscriberId(method, url, headers, payload) {
  40.           var request = superagent(method, url)
  41.           .set(headers || {})
  42.           .timeout(policy.timeout)
  43.           .ok(function (res) { return res.status })
  44.           if (payload) {
  45.             request.send(payload)
  46.           }
  47.           return request.end(function (err, res) {
  48.             const status = err ? 0 : res.status
  49.             const response = err ? err : res.body
  50.             const message = err ? 'policy call error' : 'policy call response'
  51.             console.debug(message, status, response)
  52.             return getBundle(status, response)
  53.           })
  54.         }
  55.         function updateQueryStringParameter(uri, key, value) {
  56.           var re = new RegExp("([?&])" + key + "=.*?(&|#|$)", "i")
  57.           var separator = uri.indexOf('?') !== -1 ? "&" : "?"
  58.           if (uri.match(re)) {
  59.             return uri.replace(re, '$1' + key + "=" + value + '$2')
  60.           }
  61.           else {
  62.             return uri + separator + key + "=" + value
  63.           }
  64.         }
  65.         function redirect(bundle) {
  66.           if (bundle) {
  67.             window.location.href = updateQueryStringParameter(returnTo, 'bundle', bundle)
  68.             return
  69.           }
  70.           window.location.href = returnTo
  71.         }
  72.         window.onerror = function () {
  73.           try {
  74.             redirect()
  75.           } catch (err) {
  76.             return true // Don't allow infinity of recursively unhandled errors
  77.           }
  78.         }
  79.         setTimeout(function () {
  80.           var preloaderEl = document.querySelector('.preloader');
  81.           if (preloaderEl) {
  82.             preloaderEl.style.display = 'block';
  83.           }
  84.         }, 1500)
  85.         getSubscriberId(policy.method, policy.url, policy.headers, policy.payload)
  86.       })();</script>
  87.   </body>
  88. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement