Skip to content

Commit 80c765e

Browse files
committed
Added api.get.last_active() and api.get.loggedin_accounts()
1 parent e7ce6e8 commit 80c765e

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

gmail.js renamed to src/gmail.js

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,37 @@ var Gmail = function() {
1515
};
1616

1717

18+
api.tracker.globals = GLOBALS;
19+
api.tracker.view_data = VIEW_DATA;
20+
api.tracker.ik = api.tracker.globals[9];
21+
22+
23+
24+
api.get.last_active = function() {
25+
var data = api.tracker.globals[17][15];
26+
return {
27+
time : data[1],
28+
ip : data[3],
29+
mac_address : data[9],
30+
time_relative : data[10]
31+
}
32+
}
33+
34+
35+
api.get.loggedin_accounts = function() {
36+
var data = api.tracker.globals[17][23];
37+
var users = [];
38+
39+
for(i in data[1]) {
40+
users.push({name : data[1][i][4], email : data[1][i][0]})
41+
}
42+
43+
return users;
44+
}
45+
46+
1847
api.get.user_email = function() {
19-
return GLOBALS[10];
48+
return api.tracker.globals[10];
2049
};
2150

2251

@@ -674,7 +703,7 @@ var Gmail = function() {
674703
api.tools.make_request = function (link, method) {
675704

676705
var method = (typeof method == undefined || typeof method == null) ? 'GET' : method;
677-
var request = $.ajax({ type: method, url: link, async:false });
706+
var request = $.ajax({ type: method, url: encodeURI(link), async:false });
678707

679708
return request.responseText;
680709
}
@@ -826,4 +855,4 @@ var Gmail = function() {
826855

827856

828857
return api;
829-
}
858+
}

0 commit comments

Comments
 (0)