Advertisement
2bicz

Untitled

Jun 13th, 2022
1,458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 2.31 KB | None | 0 0
  1. function createListModel(tag){
  2.         tagCopy = tag;
  3.         var url = "https://www.peka.poznan.pl/vm/method.vm?ts=1650032339385";
  4.  
  5.         var xhr = new XMLHttpRequest();
  6.         xhr.open("POST", url);
  7.         xhr.setRequestHeader("Connection", "keep-alive");
  8.         xhr.setRequestHeader("Pragma", "no-cache");
  9.         xhr.setRequestHeader("Cache-Control", "no-cache");
  10.         xhr.setRequestHeader("sec-ch-ua-mobile", "?0");
  11.         xhr.setRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.84 Safari/537.36 OPR/85.0.4341.68");
  12.         xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
  13.         xhr.setRequestHeader("Accept", "text/javascript, text/html, application/xml, text/xml, */*");
  14.         xhr.setRequestHeader("X-Prototype-Version", "1.7");
  15.         xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
  16.         xhr.setRequestHeader("Origin", "https://www.peka.poznan.pl");
  17.         xhr.setRequestHeader("Sec-Fetch-Site", "same-origin");
  18.         xhr.setRequestHeader("Sec-Fetch-Mode", "cors");
  19.         xhr.setRequestHeader("Sec-Fetch-Dest", "empty");
  20.         xhr.setRequestHeader("Referer", "https://www.peka.poznan.pl/vm/");
  21.         xhr.setRequestHeader("Accept-Language", "pl-PL,pl;q=0.9,en-US;q=0.8,en;q=0.7");
  22.         xhr.setRequestHeader("Cookie", "JSESSIONID=WtlFxT-On+DsPqMdoX2bn7-j.undefined; JSESSIONID=84B298EDCEA4AD4CAE9EC6A07DECF85D.portal; cb-enabled=enabled; __utma=200167215.1823910031.1650028435.1650028435.1650028435.1; __utmc=200167215; __utmz=200167215.1650028435.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); rodopeka=1");
  23.  
  24.         var newModel = innerListComp.createObject();
  25.         xhr.onreadystatechange = function () {
  26.            if (xhr.readyState === 4) {
  27.                var jsonResponse = JSON.parse(xhr.responseText);
  28.                var data = jsonResponse.success;
  29.                var elements = Object.keys(data.times).length;
  30.  
  31.  
  32.                for(var i = 0; i < elements; i++) {
  33.                    newModel.append(data.times[i]);
  34.                }
  35. //               nameCopy = data.bollard.name;
  36.            }
  37.         };
  38.  
  39.         var data = "method=getTimes&p0=%7B%22symbol%22%3A%22" + tag + "%22%7D";
  40.  
  41.         xhr.send(data);
  42.         return newModel;
  43.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement