-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathevents.html
161 lines (149 loc) · 5.85 KB
/
events.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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
<!-- This is a wide open CSP declaration. To lock this down for production, see below. -->
<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *" />
<!-- Good default declaration:
* gap: is required only on iOS (when using UIWebView) and is needed for JS->native communication
* https://ssl.gstatic.com is required only on Android and is needed for TalkBack to function properly
* Disables use of eval() and inline scripts in order to mitigate risk of XSS vulnerabilities. To change this:
* Enable inline JS: add 'unsafe-inline' to default-src
* Enable eval(): add 'unsafe-eval' to default-src
* Create your own at http://cspisawesome.com
-->
<!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: 'unsafe-inline' https://ssl.gstatic.com; style-src 'self' 'unsafe-inline'; media-src *" /> -->
<link rel="stylesheet" type="text/css" href="css/index.css" />
<link rel="stylesheet" type="text/css" href="css/bars.css" />
<link rel="stylesheet" href="./css/css/fontawesome-all.css" />
<script type="text/javascript" src="js/jsonQ/jsonQ.min.js"></script>
<link rel="manifest" href="./manifest.json">
<!-- <link rel="stylesheet" type="text/css" href="progress/progress.css" /> -->
<title>Eazy-T: Events</title>
<!-- <meta name="viewport" content="width=device-width" /> -->
<!-- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -->
</head>
<body id="main" onload="main()">
<script>
function main() {
if("apiKey" in localStorage){
alertify.success('API key found');
}
else {
window.location="intro.html";
}
}//END
var getJSON = function(url, callback) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'json';
xhr.onload = function() {
var status = xhr.status;
if (status === 200) {
callback(null, xhr.response);
} else {
callback(status, xhr.response);
}
};
xhr.send();
};
getJSON('https://api.torn.com/user/?selections=events&key=' + localStorage.apiKey,
function(err, data) {
if (err !== null) {
alertify.error('Cannot retrieve events: ' + err);
}
else {
var eventsS = jsonQ(data),
//to find all the name
eventsS = eventsS.find('event'),
eventsS = eventsS.value();
var eventsS = eventsS.reverse();
eventsS = eventsS.join("<br><br>");
document.getElementById("list1").innerHTML = eventsS;
}
});
function viewStored() {
//alertify.log("API Key: " + localStorage.apiKey);
alertify.log("Name: " + localStorage.playerName + " / API Key: " + localStorage.apiKey);
alertify.log("Refresh Rate: " + localStorage.refreshrate / 1000 + ' Seconds');
}
//Reloads the current window.
function reloadApp(){window.location.reload()}
function goHome() {
window.location="index.html";
}
</script>
<table border="0" cellpadding="0" cellspacing="0" class="body">
<tr>
<td> </td>
<td class="container">
<div class="content">
<!-- START CENTERED WHITE CONTAINER -->
<table class="main">
<!-- START MAIN CONTENT AREA -->
<tr>
<td class="wrapper">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<a onclick="goHome()"><h1 id="playername">Eazy-T</h1></a>
<span id="list1"></span>
</td>
</tr>
</table>
</td>
</tr>
<!-- END MAIN CONTENT AREA -->
</table>
<!-- START FOOTER -->
<div class="footer">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="content-block">
<table class="btn btn-primary">
<tbody>
<tr>
<td>
<center><table border="0" cellpadding="0" cellspacing="15">
<tbody>
<tr>
<td> <a onclick="goHome()"><i class="fas fa-home fa-2x"></i></a> </td>
</tr>
</tbody>
</table></center>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
Created by: <a href="https://www.torn.com/profiles.php?XID=1947498">LunarControl</a>
</td>
</tr>
</table>
</div>
<!-- END FOOTER -->
<!-- END CENTERED WHITE CONTAINER -->
</div>
</td>
<td> </td>
</tr>
</table>
<script src="//unpkg.com/[email protected]/touch-emulator.js"></script>
<script>TouchEmulator()</script>
<script type="text/javascript" src="js/pulltorefresh-js-0.1.14/dist/pulltorefresh.js"></script>
<script type="text/javascript" src="js/alertify.js"></script>
<script>
/* global PullToRefresh */
PullToRefresh.init({
mainElement: '#main',
onRefresh: function() { reloadApp(); }
});
</script>
</body>
</html>