-
Notifications
You must be signed in to change notification settings - Fork 0
/
aptget.html
54 lines (54 loc) · 1.96 KB
/
aptget.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<script>
var DATA_URL = 'https://www.irvinecompanyapartments.com/snp?sp_q_1=unit&sp_x_1=entityType&sp_x_3=communityIdAEM&sp_q_3=7d86836c-feda-4653-9a89-c6f4113ec655&sp_q_4=ica&sp_x_4=appId&app=icaFloorplanPage&sp_s=planName&upm_field_table=1&sp_x_2=floorplanIdCRM&sp_q_2=';
function show(plan_id) {
$.get(DATA_URL + plan_id, function(html) {
var page = JSON.parse(html);
console.log(page);
var plan = null;
var units = [];
for (var i = 0; i < page.resultsets.length; ++i) {
var resultset = page.resultsets[i];
for (var j = 0; j < resultset.results.length; ++j) {
var result = resultset.results[j];
plan = result.floorplanMarketingName;
units.push(result);
// document.write(plan_id + ' ' + result.floorplanMarketingName + ' ' + result.unitMarketingName + ', ');
// document.write(JSON.stringify(result, null, 2));
}
}
if (plan) {
var text = result.floorplanMarketingName + ': ';
units.sort(function (a, b) {
var c = a.unitMarketingName;
var d = b.unitMarketingName;
return c < d ? -1 : c > d ? 1 : 0;
});
for (var i in units) {
var unit = units[i];
text += (i == 0 ? '' : ', ') + unit.unitMarketingName + ' ($' + unit.marketRent + ')';
}
$(document.body).append($('<p>').text(text));
}
});
document.write('</ br>')
}
/*
for (var i = 2048; i < 2*2048; ++i) {
var id = (i.toString(16) + '').toUpperCase().padStart(3, '0');
show('0x0000000000000' + id);
// console.log(id);
}
*/
var PLAN_ONE = '0x0000000000000753';
var plans = [PLAN_ONE, '0x000000000000075C'];
for (var i in plans) {
show(plans[i]);
}
</script>
</body>
</html>