forked from davidfu13/polling591
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pushbullethandler.js
41 lines (34 loc) · 1.12 KB
/
pushbullethandler.js
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
function getMobileDevId() {
var deviceList = PushBullet.devices().devices;
var mobileDevId;
deviceList.forEach(function(element, index, array) {
if (element.icon === "phone") {
mobileDevId = element.iden;
return false;
}
});
return mobileDevId;
}
function notifyNewHouseMobileOneHouse(jHouse) {
PushBullet.push('link', getMobileDevId(), null, {
title: jHouse.price + ' ' + jHouse.size + ' ' + jHouse.address,
url: jHouse.link,
body: jHouse.title + ' ' +
jHouse.price + ' ' +
jHouse.size + ' ' +
jHouse.address + ' ' +
jHouse.desc
});
}
function notifyNewHouseMobile(jHousesToNotify) {
PushBullet.APIKey = "o.5CrvTMg7sLSvkeQ533l1x61tFtgO1xVj";
jHousesToNotify.forEach(function(element, index, array) {
notifyNewHouseMobileOneHouse(element);
});
}
function notifyNewHouseMobileForGrace(jHousesToNotify) {
PushBullet.APIKey = "o.XmdR8wGFrQrcI10f1CrU7tjgJ5IqzsHp";
jHousesToNotify.forEach(function(element, index, array) {
notifyNewHouseMobileOneHouse(element);
});
}