Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createListModel(tag){
- tagCopy = tag;
- var url = "https://www.peka.poznan.pl/vm/method.vm?ts=1650032339385";
- var xhr = new XMLHttpRequest();
- xhr.open("POST", url);
- xhr.setRequestHeader("Connection", "keep-alive");
- xhr.setRequestHeader("Pragma", "no-cache");
- xhr.setRequestHeader("Cache-Control", "no-cache");
- xhr.setRequestHeader("sec-ch-ua-mobile", "?0");
- 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");
- xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
- xhr.setRequestHeader("Accept", "text/javascript, text/html, application/xml, text/xml, */*");
- xhr.setRequestHeader("X-Prototype-Version", "1.7");
- xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
- xhr.setRequestHeader("Origin", "https://www.peka.poznan.pl");
- xhr.setRequestHeader("Sec-Fetch-Site", "same-origin");
- xhr.setRequestHeader("Sec-Fetch-Mode", "cors");
- xhr.setRequestHeader("Sec-Fetch-Dest", "empty");
- xhr.setRequestHeader("Referer", "https://www.peka.poznan.pl/vm/");
- xhr.setRequestHeader("Accept-Language", "pl-PL,pl;q=0.9,en-US;q=0.8,en;q=0.7");
- 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");
- var newModel = innerListComp.createObject();
- xhr.onreadystatechange = function () {
- if (xhr.readyState === 4) {
- var jsonResponse = JSON.parse(xhr.responseText);
- var data = jsonResponse.success;
- var elements = Object.keys(data.times).length;
- for(var i = 0; i < elements; i++) {
- newModel.append(data.times[i]);
- }
- // nameCopy = data.bollard.name;
- }
- };
- var data = "method=getTimes&p0=%7B%22symbol%22%3A%22" + tag + "%22%7D";
- xhr.send(data);
- return newModel;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement