forked from JuicyPasta/DNDHackathon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
38 lines (33 loc) · 1.53 KB
/
test.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
var request = require('request');
var cheerio = require('cheerio');
var url = "http://polyratings.com/stats.phtml?profid=778";
request(url, function (error, response, body) {
if (!error && response.statusCode == 200) {
//console.log(body);
$ = cheerio.load(body);
var thing = $('font');
console.log(response);
//console.log(thing);
//console.log("overall statistics");
//console.log("Total evaluations: " + thing[28].children[0].data);
//console.log("Mean: " + thing[30].children[0].data);
//console.log("Mode: " + thing[34].children[0].data);
//console.log("Standard Deviation: " + thing[36].children[0].data);
//console.log("ability to present material");
//console.log("Mean: " + thing[40].children[0].data);
//console.log("Mode: " + thing[44].children[0].data);
//console.log("Standard Deviation: " + thing[46].children[0].data);
//console.log("ability to present material");
//console.log("Mean: " + thing[50].children[0].data);
//console.log("Mode: " + thing[54].children[0].data);
//console.log("Standard Deviation: " + thing[56].children[0].data);
var deptSelect = $('font');
var dept = deptSelect[3].children[0].data;
var teacher = deptSelect[2].children[0].data;
for (var i = 0; i < 100; i++) {
if (thing[i] && thing[i].children && thing[i].children.length > 0) {
console.log(i + ' ' + thing[i].children[0].data);
}
}
}
});