Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function submit(obj, response) {
- obj['response'] = btoa(response);
- var http = new XMLHttpRequest();
- http.open("POST", "http://fido.dmillerw.me/pogs/upload");
- http.setRequestHeader("Content-Type", "application/json");
- http.send(JSON.stringify(obj));
- }
- function run() {
- var http = new XMLHttpRequest();
- http.open("GET", "http://fido.dmillerw.me/pogs/keys");
- http.send();
- var keys = JSON.parse(http.response);
- var viewType = 1;
- var rows = document.getElementsByTagName("tr");
- for (var i=12; i<14; i++) {
- var row = rows[i];
- var dbKey = row.children[2].innerText;
- if (keys.includes(parseInt(dbKey)))
- continue;
- var floorplanId = row.children[3].innerText;
- var description = row.children[4].innerText;
- var width = row.children[5].innerText;
- var height = row.children[6].innerText;
- var effectiveDate = row.children[7].innerText;
- var obj = {
- 'dbKey': dbKey,
- 'floorplanId': floorplanId,
- 'description': description,
- 'width': width,
- 'height': height,
- 'effectiveDate': effectiveDate
- };
- http = new XMLHttpRequest();
- http.open("GET", "http://ddcikbwebp02vw.petc.com/ikb/CompactDocumentConverterHandler.ashx?dbKey=" + dbKey + "&viewType=" + viewType + "&objectType=1");
- http.onload = function(e) {
- submit(obj, this.response)
- };
- http.onerror = function(e) {
- console.log(http.statusText);
- };
- http.send();
- console.log(obj);
- }
- }
- run();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement