-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloading.js
More file actions
106 lines (92 loc) · 3 KB
/
loading.js
File metadata and controls
106 lines (92 loc) · 3 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
var page = require('webpage').create(),
system = require('system'),
t, address;
t = Date.now();
address1 = "http://16.sync-playz.appspot.com/user1-aghbc/3.3-everyBatch_TARGET003.htm";
page.open(address1, function (status) {
if (status !== 'success') {
console.log('FAIL to load the address');
} else {
t = Date.now() - t;
console.log('Page title is ' + page.evaluate(function () {
return document.title;
}));
console.log('Loading time ' + t + ' msec');
}
// phantom.exit();
});
m = (new Date()).getMinutes();
h = (new Date()).getHours();
if (h == 17) {
if (m <= 10) { // 26:10 -
// 日の出・日没時間・月の満ち欠けの設定。
address2 = "http://16.sync-playz.appspot.com/user1-aghbc/3.3-Daily_TARGET.htm";
page.open(address2, function (status) {
if (status !== 'success') {
console.log('FAIL to load the address');
} else {
t = Date.now() - t;
console.log('Page title is ' + page.evaluate(function () {
return document.title;
}));
console.log('Loading time ' + m);
}
// phantom.exit();
});
}
}
if (h == 11) {
if (m <= 10) { // 20:10 -
// 日の出・日没時間の洗い替え。
address3 = "http://16.sync-playz.appspot.com/user1-aghbc/3.3-everySun_TARGET003.htm";
page.open(address3, function (status) {
if (status !== 'success') {
console.log('FAIL to load the address');
} else {
t = Date.now() - t;
console.log('Page title is ' + page.evaluate(function () {
return document.title;
}));
console.log('Loading time ' + m);
}
// phantom.exit();
});
}
}
if (h == 12) {
if (m <= 10) { // 21:10 -
// Scoreを「かきまぜる」役目。
address4 = "http://16.sync-playz.appspot.com/user1-aghbc/3.3-everyBatch_Score_TARGET.htm";
page.open(address4, function (status) {
if (status !== 'success') {
console.log('FAIL to load the address');
} else {
t = Date.now() - t;
console.log('Page title is ' + page.evaluate(function () {
return document.title;
}));
console.log('Loading time ' + m);
}
// phantom.exit();
});
}
}
if ( h%3 == 1 ) { // 9時間差のため、偶数時に稼働 9時間差のため、1,4,7,10,13,16,19,22時に稼働
if (m >= 30) {
if (m <= 40){
address5 = "http://16.sync-playz.appspot.com/user1-aghbc/3.3-Weather_TARGET.htm";
page.open(address5, function (status) {
if (status !== 'success') {
console.log('FAIL to load the address');
} else {
t = Date.now() - t;
console.log('Page title is ' + page.evaluate(function () {
return document.title;
}));
console.log('TIME: M:' + m);
}
});
}
}
}
phantom.exit();