-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
250 lines (243 loc) · 48.9 KB
/
index.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<html>
<head>
<title>Wales r/place bot</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
</head>
<body class="d-flex h-100 text-center text-white bg-dark">
<div class="cover-container d-flex w-100 h-100 p-3 mx-auto flex-column">
<header class="mb-auto">
<div>
<h3 class="float-md-start mb-0">Wales r/place bot</h3>
<nav class="nav nav-masthead justify-content-center float-md-end">
</nav>
</div>
</header>
<main class="px-3">
<div class="alert alert-warning" role="alert">
Thanks for helping out, it was a blast!
</div>
<p id="token">
<p id="time">Time until next tile place: No Token provided</p>
Log: <ul id="log"></ul>
<img src='flag.png' id='flag' style='height: 40vh' />
</main>
<footer class="mt-auto text-white-50">
<p>Cymru am byth! by rhld16</p>
<p id='version'>Version: </p>
</footer>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js" integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13" crossorigin="anonymous"></script>
<script type="text/javascript">
var pixels = {"81,115": "000000", "82,115": "000000", "83,115": "000000", "84,115": "000000", "85,115": "000000", "86,115": "000000", "87,115": "000000", "88,115": "000000", "89,115": "000000", "90,115": "000000", "91,115": "000000", "92,115": "000000", "93,115": "000000", "94,115": "000000", "95,115": "000000", "96,115": "000000", "97,115": "000000", "98,115": "000000", "99,115": "000000", "100,115": "000000", "101,115": "000000", "102,115": "000000", "103,115": "000000", "104,115": "000000", "105,115": "000000", "106,115": "000000", "107,115": "000000", "108,115": "000000", "109,115": "000000", "110,115": "000000", "111,115": "000000", "112,115": "000000", "113,115": "000000", "114,115": "000000", "115,115": "000000", "116,115": "000000", "117,115": "000000", "118,115": "000000", "119,115": "000000", "120,115": "000000", "121,115": "000000", "122,115": "000000", "123,115": "000000", "124,115": "000000", "125,115": "000000", "126,115": "000000", "127,115": "000000", "128,115": "000000", "129,115": "000000", "130,115": "000000", "81,116": "000000", "82,116": "ffffff", "83,116": "ffffff", "84,116": "ffffff", "85,116": "ffffff", "86,116": "ffffff", "87,116": "ffffff", "88,116": "ffffff", "89,116": "ffffff", "90,116": "ffffff", "91,116": "ffffff", "92,116": "ffffff", "93,116": "ffffff", "94,116": "ffffff", "95,116": "ffffff", "96,116": "ffffff", "97,116": "ffffff", "98,116": "ffffff", "99,116": "ffffff", "100,116": "ffffff", "101,116": "ffffff", "102,116": "ffffff", "103,116": "ffffff", "104,116": "ffffff", "105,116": "ffffff", "106,116": "ffffff", "107,116": "ffffff", "108,116": "ffffff", "109,116": "ffffff", "110,116": "ffffff", "111,116": "ffffff", "112,116": "ffffff", "113,116": "ffffff", "114,116": "ffffff", "115,116": "ffffff", "116,116": "ffffff", "117,116": "ffffff", "118,116": "ffffff", "119,116": "ffffff", "120,116": "ffffff", "121,116": "ffffff", "122,116": "ffffff", "123,116": "ffffff", "124,116": "000000", "125,116": "000000", "126,116": "000000", "127,116": "000000", "128,116": "000000", "129,116": "000000", "130,116": "000000", "81,117": "000000", "82,117": "ffffff", "83,117": "ffffff", "84,117": "ffffff", "85,117": "ffffff", "86,117": "ffffff", "87,117": "ffffff", "88,117": "ffffff", "89,117": "ffffff", "90,117": "ffffff", "91,117": "ffffff", "92,117": "ffffff", "93,117": "ffffff", "94,117": "ffffff", "95,117": "ffffff", "96,117": "ffffff", "97,117": "ffffff", "98,117": "ffffff", "99,117": "ffffff", "100,117": "ffffff", "101,117": "ffffff", "102,117": "ffffff", "103,117": "ffffff", "104,117": "ffffff", "105,117": "ffffff", "106,117": "ffffff", "107,117": "ffffff", "108,117": "ffffff", "109,117": "ffffff", "110,117": "ffffff", "111,117": "ffffff", "112,117": "ffffff", "113,117": "ffffff", "114,117": "ffffff", "115,117": "ffffff", "116,117": "ffffff", "117,117": "ffffff", "118,117": "ffffff", "119,117": "ffffff", "120,117": "ffffff", "121,117": "ffffff", "122,117": "ffffff", "123,117": "ffffff", "124,117": "000000", "125,117": "000000", "126,117": "000000", "127,117": "ffd635", "128,117": "000000", "129,117": "000000", "130,117": "000000", "81,118": "000000", "82,118": "ffffff", "83,118": "ffffff", "84,118": "ffffff", "85,118": "ffffff", "86,118": "ffffff", "87,118": "ffffff", "88,118": "ffffff", "89,118": "ffffff", "90,118": "ffffff", "91,118": "ffffff", "92,118": "c21138", "93,118": "c21138", "94,118": "c21138", "95,118": "ffffff", "96,118": "ffffff", "97,118": "ffffff", "98,118": "ffffff", "99,118": "ffffff", "100,118": "ffffff", "101,118": "ffffff", "102,118": "ffffff", "103,118": "ffffff", "104,118": "ffffff", "105,118": "ffffff", "106,118": "ffffff", "107,118": "c21138", "108,118": "ffffff", "109,118": "ffffff", "110,118": "ffffff", "111,118": "ffffff", "112,118": "ffffff", "113,118": "ffffff", "114,118": "ffffff", "115,118": "c21138", "116,118": "ffffff", "117,118": "ffffff", "118,118": "ffffff", "119,118": "ffffff", "120,118": "ffffff", "121,118": "ffffff", "122,118": "ffffff", "123,118": "ffffff", "124,118": "000000", "125,118": "ffd635", "126,118": "ffd635", "127,118": "ffd635", "128,118": "ffd635", "129,118": "ffd635", "130,118": "000000", "81,119": "000000", "82,119": "ffffff", "83,119": "ffffff", "84,119": "ffffff", "85,119": "ffffff", "86,119": "ffffff", "87,119": "c21138", "88,119": "c21138", "89,119": "ff4500", "90,119": "ff4500", "91,119": "c21138", "92,119": "ff4500", "93,119": "ff4500", "94,119": "ffffff", "95,119": "ffffff", "96,119": "ffffff", "97,119": "ffffff", "98,119": "ffffff", "99,119": "ffffff", "100,119": "ffffff", "101,119": "ffffff", "102,119": "ffffff", "103,119": "ffffff", "104,119": "ffffff", "105,119": "c21138", "106,119": "c21138", "107,119": "ff4500", "108,119": "ffffff", "109,119": "ffffff", "110,119": "ffffff", "111,119": "ffffff", "112,119": "c21138", "113,119": "c21138", "114,119": "c21138", "115,119": "ffffff", "116,119": "ffffff", "117,119": "ffffff", "118,119": "ffffff", "119,119": "ffffff", "120,119": "ffffff", "121,119": "ffffff", "122,119": "ffffff", "123,119": "ffffff", "124,119": "000000", "125,119": "000000", "126,119": "000000", "127,119": "ffd635", "128,119": "000000", "129,119": "000000", "130,119": "000000", "81,120": "000000", "82,120": "ffffff", "83,120": "ff4500", "84,120": "ff4500", "85,120": "ff4500", "86,120": "ff4500", "87,120": "ff4500", "88,120": "000000", "89,120": "ff4500", "90,120": "ff4500", "91,120": "ff4500", "92,120": "ff4500", "93,120": "ffffff", "94,120": "ffffff", "95,120": "ffffff", "96,120": "ffffff", "97,120": "ffffff", "98,120": "ffffff", "99,120": "ffffff", "100,120": "ffffff", "101,120": "ffffff", "102,120": "ffffff", "103,120": "c21138", "104,120": "c21138", "105,120": "ff4500", "106,120": "ff4500", "107,120": "ff4500", "108,120": "ffffff", "109,120": "ffffff", "110,120": "c21138", "111,120": "c21138", "112,120": "ff4500", "113,120": "ff4500", "114,120": "ffffff", "115,120": "ffffff", "116,120": "ffffff", "117,120": "ffffff", "118,120": "ffffff", "119,120": "ffffff", "120,120": "ffffff", "121,120": "ffffff", "122,120": "ffffff", "123,120": "ffffff", "124,120": "000000", "125,120": "000000", "126,120": "000000", "127,120": "000000", "128,120": "000000", "129,120": "000000", "130,120": "000000", "81,121": "c21138", "82,121": "ffffff", "83,121": "ffffff", "84,121": "ffffff", "85,121": "ff4500", "86,121": "ff4500", "87,121": "ff4500", "88,121": "ff4500", "89,121": "ff4500", "90,121": "ff4500", "91,121": "c21138", "92,121": "ff4500", "93,121": "ff4500", "94,121": "ff4500", "95,121": "ffffff", "96,121": "ffffff", "97,121": "ffffff", "98,121": "ffffff", "99,121": "ffffff", "100,121": "ffffff", "101,121": "c21138", "102,121": "c21138", "103,121": "ff4500", "104,121": "ff4500", "105,121": "ff4500", "106,121": "ff4500", "107,121": "ff4500", "108,121": "c21138", "109,121": "c21138", "110,121": "ff4500", "111,121": "ff4500", "112,121": "ff4500", "113,121": "ff4500", "114,121": "ffffff", "115,121": "ffffff", "116,121": "ffffff", "117,121": "ffffff", "118,121": "ffffff", "119,121": "ff4500", "120,121": "ffffff", "121,121": "ffffff", "122,121": "ffffff", "123,121": "ffffff", "124,121": "000000", "125,121": "ffd635", "126,121": "000000", "127,121": "ffd635", "128,121": "ffd635", "129,121": "ffd635", "130,121": "000000", "81,122": "c21138", "82,122": "ff4500", "83,122": "ff4500", "84,122": "ff4500", "85,122": "ff4500", "86,122": "ff4500", "87,122": "ff4500", "88,122": "ff4500", "89,122": "ff4500", "90,122": "ff4500", "91,122": "c21138", "92,122": "ff4500", "93,122": "c21138", "94,122": "ffffff", "95,122": "ffffff", "96,122": "ffffff", "97,122": "ffffff", "98,122": "ffffff", "99,122": "ffffff", "100,122": "c21138", "101,122": "ff4500", "102,122": "ff4500", "103,122": "ff4500", "104,122": "ff4500", "105,122": "c21138", "106,122": "c21138", "107,122": "c21138", "108,122": "ff4500", "109,122": "ff4500", "110,122": "ff4500", "111,122": "c21138", "112,122": "c21138", "113,122": "c21138", "114,122": "c21138", "115,122": "ffffff", "116,122": "ffffff", "117,122": "ffffff", "118,122": "ff4500", "119,122": "ff4500", "120,122": "ffffff", "121,122": "ffffff", "122,122": "ffffff", "123,122": "ffffff", "124,122": "000000", "125,122": "ffd635", "126,122": "000000", "127,122": "ffd635", "128,122": "000000", "129,122": "ffd635", "130,122": "000000", "81,123": "ffffff", "82,123": "ffffff", "83,123": "ffffff", "84,123": "ffffff", "85,123": "ff4500", "86,123": "ff4500", "87,123": "ffffff", "88,123": "ffffff", "89,123": "c21138", "90,123": "c21138", "91,123": "ff4500", "92,123": "ff4500", "93,123": "ff4500", "94,123": "ff4500", "95,123": "ffffff", "96,123": "ffffff", "97,123": "ffffff", "98,123": "ffffff", "99,123": "c21138", "100,123": "ff4500", "101,123": "ff4500", "102,123": "ff4500", "103,123": "c21138", "104,123": "c21138", "105,123": "ff4500", "106,123": "ff4500", "107,123": "ff4500", "108,123": "ff4500", "109,123": "c21138", "110,123": "c21138", "111,123": "ff4500", "112,123": "ff4500", "113,123": "ffffff", "114,123": "ffffff", "115,123": "ffffff", "116,123": "ffffff", "117,123": "ff4500", "118,123": "ff4500", "119,123": "c21138", "120,123": "ffffff", "121,123": "ffffff", "122,123": "ffffff", "123,123": "ffffff", "124,123": "000000", "125,123": "ffd635", "126,123": "ffd635", "127,123": "ffd635", "128,123": "000000", "129,123": "ffd635", "130,123": "000000", "81,124": "ffffff", "82,124": "ff4500", "83,124": "ffffff", "84,124": "ffffff", "85,124": "c21138", "86,124": "ffffff", "87,124": "ffffff", "88,124": "c21138", "89,124": "ff4500", "90,124": "ff4500", "91,124": "c21138", "92,124": "ff4500", "93,124": "c21138", "94,124": "ffffff", "95,124": "ffffff", "96,124": "ffffff", "97,124": "ffffff", "98,124": "c21138", "99,124": "c21138", "100,124": "ff4500", "101,124": "c21138", "102,124": "c21138", "103,124": "ff4500", "104,124": "ff4500", "105,124": "ff4500", "106,124": "c21138", "107,124": "c21138", "108,124": "c21138", "109,124": "ff4500", "110,124": "ff4500", "111,124": "ffffff", "112,124": "ffffff", "113,124": "ffffff", "114,124": "ffffff", "115,124": "ffffff", "116,124": "ff4500", "117,124": "ff4500", "118,124": "ff4500", "119,124": "c21138", "120,124": "ffffff", "121,124": "ffffff", "122,124": "ffffff", "123,124": "ffffff", "124,124": "000000", "125,124": "000000", "126,124": "000000", "127,124": "000000", "128,124": "000000", "129,124": "000000", "130,124": "000000", "81,125": "c21138", "82,125": "ffffff", "83,125": "c21138", "84,125": "ffffff", "85,125": "ffffff", "86,125": "ffffff", "87,125": "ffffff", "88,125": "ff4500", "89,125": "ff4500", "90,125": "ff4500", "91,125": "ff4500", "92,125": "ff4500", "93,125": "ff4500", "94,125": "ff4500", "95,125": "ffffff", "96,125": "ffffff", "97,125": "ffffff", "98,125": "c21138", "99,125": "c21138", "100,125": "ff4500", "101,125": "ff4500", "102,125": "ff4500", "103,125": "ff4500", "104,125": "ff4500", "105,125": "ff4500", "106,125": "ff4500", "107,125": "ff4500", "108,125": "ff4500", "109,125": "ff4500", "110,125": "ffffff", "111,125": "ffffff", "112,125": "ffffff", "113,125": "ffffff", "114,125": "ffffff", "115,125": "ffffff", "116,125": "ffffff", "117,125": "ff4500", "118,125": "c21138", "119,125": "ffffff", "120,125": "ffffff", "121,125": "ffffff", "122,125": "ffffff", "123,125": "ffffff", "124,125": "000000", "125,125": "ffd635", "126,125": "000000", "127,125": "ffd635", "128,125": "000000", "129,125": "ffd635", "130,125": "000000", "81,126": "c21138", "82,126": "ff4500", "83,126": "ff4500", "84,126": "ffffff", "85,126": "ffffff", "86,126": "ffffff", "87,126": "c21138", "88,126": "ff4500", "89,126": "ff4500", "90,126": "ff4500", "91,126": "ff4500", "92,126": "ff4500", "93,126": "c21138", "94,126": "ffffff", "95,126": "ffffff", "96,126": "ffffff", "97,126": "ffffff", "98,126": "c21138", "99,126": "c21138", "100,126": "ff4500", "101,126": "ff4500", "102,126": "ff4500", "103,126": "ff4500", "104,126": "ff4500", "105,126": "c21138", "106,126": "c21138", "107,126": "c21138", "108,126": "c21138", "109,126": "c21138", "110,126": "ffffff", "111,126": "ffffff", "112,126": "ffffff", "113,126": "ffffff", "114,126": "ff4500", "115,126": "ff4500", "116,126": "ff4500", "117,126": "ff4500", "118,126": "ffffff", "119,126": "ffffff", "120,126": "ffffff", "121,126": "ffffff", "122,126": "ffffff", "123,126": "ffffff", "124,126": "000000", "125,126": "ffd635", "126,126": "000000", "127,126": "ffd635", "128,126": "000000", "129,126": "ffd635", "130,126": "000000", "81,127": "ff4500", "82,127": "ff4500", "83,127": "ffffff", "84,127": "ffffff", "85,127": "ffffff", "86,127": "ffffff", "87,127": "ff4500", "88,127": "c21138", "89,127": "ff4500", "90,127": "ff4500", "91,127": "ff4500", "92,127": "ff4500", "93,127": "ff4500", "94,127": "ff4500", "95,127": "ffffff", "96,127": "ffffff", "97,127": "ffffff", "98,127": "c21138", "99,127": "ff4500", "100,127": "ff4500", "101,127": "ff4500", "102,127": "c21138", "103,127": "ff4500", "104,127": "ff4500", "105,127": "ff4500", "106,127": "ff4500", "107,127": "ff4500", "108,127": "ff4500", "109,127": "ff4500", "110,127": "c21138", "111,127": "ffffff", "112,127": "ffffff", "113,127": "ffffff", "114,127": "ff4500", "115,127": "ffffff", "116,127": "c21138", "117,127": "ff4500", "118,127": "ff4500", "119,127": "ffffff", "120,127": "ffffff", "121,127": "ffd635", "122,127": "ffffff", "123,127": "ffffff", "124,127": "000000", "125,127": "ffd635", "126,127": "ffd635", "127,127": "ffd635", "128,127": "ffd635", "129,127": "ffd635", "130,127": "000000", "81,128": "c21138", "82,128": "ffffff", "83,128": "ffffff", "84,128": "ffffff", "85,128": "ffffff", "86,128": "c21138", "87,128": "ff4500", "88,128": "ff4500", "89,128": "ff4500", "90,128": "ff4500", "91,128": "ff4500", "92,128": "ff4500", "93,128": "c21138", "94,128": "ffffff", "95,128": "ffffff", "96,128": "ffffff", "97,128": "c21138", "98,128": "ff4500", "99,128": "ff4500", "100,128": "ff4500", "101,128": "ff4500", "102,128": "ff4500", "103,128": "c21138", "104,128": "ff4500", "105,128": "ff4500", "106,128": "ff4500", "107,128": "ff4500", "108,128": "c21138", "109,128": "c21138", "110,128": "ffffff", "111,128": "c21138", "112,128": "ffffff", "113,128": "ffffff", "114,128": "ff4500", "115,128": "c21138", "116,128": "c21138", "117,128": "ff4500", "118,128": "ff4500", "119,128": "ffffff", "120,128": "ffd635", "121,128": "ff4500", "122,128": "ffd635", "123,128": "ffffff", "124,128": "000000", "125,128": "000000", "126,128": "000000", "127,128": "000000", "128,128": "000000", "129,128": "000000", "130,128": "000000", "81,129": "c21138", "82,129": "ffffff", "83,129": "ffffff", "84,129": "ffffff", "85,129": "ffffff", "86,129": "ff4500", "87,129": "c21138", "88,129": "c21138", "89,129": "ff4500", "90,129": "ff4500", "91,129": "ff4500", "92,129": "c21138", "93,129": "c21138", "94,129": "c21138", "95,129": "ff4500", "96,129": "ff4500", "97,129": "ff4500", "98,129": "ff4500", "99,129": "ff4500", "100,129": "ff4500", "101,129": "c21138", "102,129": "ff4500", "103,129": "ff4500", "104,129": "c21138", "105,129": "c21138", "106,129": "ff4500", "107,129": "c21138", "108,129": "ffffff", "109,129": "ffffff", "110,129": "ffffff", "111,129": "ffffff", "112,129": "ffffff", "113,129": "ffffff", "114,129": "ffffff", "115,129": "ffffff", "116,129": "ffffff", "117,129": "ff4500", "118,129": "ff4500", "119,129": "ffffff", "120,129": "ffffff", "121,129": "ffd635", "122,129": "ffffff", "123,129": "ffffff", "124,129": "000000", "125,129": "000000", "126,129": "000000", "127,129": "000000", "128,129": "000000", "129,129": "ffd635", "130,129": "000000", "81,130": "ff4500", "82,130": "ffffff", "83,130": "ffffff", "84,130": "ffffff", "85,130": "c21138", "86,130": "ff4500", "87,130": "ff4500", "88,130": "ff4500", "89,130": "ff4500", "90,130": "ff4500", "91,130": "c21138", "92,130": "ff4500", "93,130": "ff4500", "94,130": "ff4500", "95,130": "ff4500", "96,130": "c21138", "97,130": "ff4500", "98,130": "ff4500", "99,130": "c21138", "100,130": "ff4500", "101,130": "ff4500", "102,130": "c21138", "103,130": "ff4500", "104,130": "ff4500", "105,130": "ff4500", "106,130": "c21138", "107,130": "c21138", "108,130": "ff4500", "109,130": "ff4500", "110,130": "ff4500", "111,130": "ff4500", "112,130": "ffffff", "113,130": "ffffff", "114,130": "ffffff", "115,130": "ffffff", "116,130": "ff4500", "117,130": "ff4500", "118,130": "c21138", "119,130": "ffffff", "120,130": "ffffff", "121,130": "00cc78", "122,130": "ffffff", "123,130": "ffffff", "124,130": "000000", "125,130": "ffd635", "126,130": "ffd635", "127,130": "ffd635", "128,130": "ffd635", "129,130": "ffd635", "130,130": "000000", "81,131": "ff4500", "82,131": "00a368", "83,131": "00a368", "84,131": "00a368", "85,131": "ff4500", "86,131": "c21138", "87,131": "c21138", "88,131": "ff4500", "89,131": "ff4500", "90,131": "c21138", "91,131": "ff4500", "92,131": "ff4500", "93,131": "ff4500", "94,131": "ff4500", "95,131": "c21138", "96,131": "ff4500", "97,131": "ff4500", "98,131": "c21138", "99,131": "ff4500", "100,131": "c21138", "101,131": "ff4500", "102,131": "ff4500", "103,131": "c21138", "104,131": "ff4500", "105,131": "ff4500", "106,131": "ff4500", "107,131": "ff4500", "108,131": "c21138", "109,131": "ff4500", "110,131": "ff4500", "111,131": "ff4500", "112,131": "ff4500", "113,131": "ff4500", "114,131": "ff4500", "115,131": "ff4500", "116,131": "ff4500", "117,131": "ff4500", "118,131": "c21138", "119,131": "00a368", "120,131": "00a368", "121,131": "00a368", "122,131": "00a368", "123,131": "00a368", "124,131": "000000", "125,131": "000000", "126,131": "000000", "127,131": "000000", "128,131": "000000", "129,131": "000000", "130,131": "000000", "81,132": "ff4500", "82,132": "c21138", "83,132": "00a368", "84,132": "00a368", "85,132": "ff4500", "86,132": "ff4500", "87,132": "ff4500", "88,132": "ff4500", "89,132": "c21138", "90,132": "ff4500", "91,132": "ff4500", "92,132": "ff4500", "93,132": "ff4500", "94,132": "ff4500", "95,132": "ff4500", "96,132": "ff4500", "97,132": "ff4500", "98,132": "c21138", "99,132": "ff4500", "100,132": "ff4500", "101,132": "c21138", "102,132": "ff4500", "103,132": "ff4500", "104,132": "c21138", "105,132": "ff4500", "106,132": "c21138", "107,132": "c21138", "108,132": "ff4500", "109,132": "c21138", "110,132": "ff4500", "111,132": "ff4500", "112,132": "ff4500", "113,132": "ff4500", "114,132": "ff4500", "115,132": "ff4500", "116,132": "ff4500", "117,132": "c21138", "118,132": "00a368", "119,132": "00a368", "120,132": "00a368", "121,132": "00a368", "122,132": "00a368", "123,132": "00a368", "124,132": "000000", "125,132": "ffd635", "126,132": "ffd635", "127,132": "ffd635", "128,132": "ffd635", "129,132": "ffd635", "130,132": "000000", "81,133": "ff4500", "82,133": "ff4500", "83,133": "00a368", "84,133": "00a368", "85,133": "c21138", "86,133": "c21138", "87,133": "c21138", "88,133": "ff4500", "89,133": "c21138", "90,133": "c21138", "91,133": "ff4500", "92,133": "ff4500", "93,133": "c21138", "94,133": "ff4500", "95,133": "ff4500", "96,133": "ff4500", "97,133": "c21138", "98,133": "ff4500", "99,133": "ff4500", "100,133": "ff4500", "101,133": "c21138", "102,133": "ff4500", "103,133": "c21138", "104,133": "ff4500", "105,133": "c21138", "106,133": "ff4500", "107,133": "ff4500", "108,133": "ff4500", "109,133": "ff4500", "110,133": "ff4500", "111,133": "c21138", "112,133": "ff4500", "113,133": "ff4500", "114,133": "ff4500", "115,133": "c21138", "116,133": "c21138", "117,133": "00a368", "118,133": "00a368", "119,133": "00a368", "120,133": "00a368", "121,133": "00a368", "122,133": "00a368", "123,133": "00a368", "124,133": "000000", "125,133": "ffd635", "126,133": "000000", "127,133": "ffd635", "128,133": "000000", "129,133": "000000", "130,133": "000000", "81,134": "ff4500", "82,134": "ff4500", "83,134": "c21138", "84,134": "00a368", "85,134": "00a368", "86,134": "ff4500", "87,134": "ff4500", "88,134": "ff4500", "89,134": "ff4500", "90,134": "ff4500", "91,134": "c21138", "92,134": "c21138", "93,134": "ff4500", "94,134": "c21138", "95,134": "c21138", "96,134": "c21138", "97,134": "ff4500", "98,134": "c21138", "99,134": "c21138", "100,134": "c21138", "101,134": "ff4500", "102,134": "c21138", "103,134": "ff4500", "104,134": "ff4500", "105,134": "ff4500", "106,134": "ff4500", "107,134": "ff4500", "108,134": "ff4500", "109,134": "ff4500", "110,134": "ff4500", "111,134": "ff4500", "112,134": "c21138", "113,134": "c21138", "114,134": "c21138", "115,134": "00a368", "116,134": "00a368", "117,134": "00a368", "118,134": "00a368", "119,134": "00a368", "120,134": "00a368", "121,134": "00a368", "122,134": "00a368", "123,134": "00a368", "124,134": "000000", "125,134": "ffd635", "126,134": "ffd635", "127,134": "ffd635", "128,134": "ffd635", "129,134": "ffd635", "130,134": "000000", "81,135": "00a368", "82,135": "ff4500", "83,135": "ff4500", "84,135": "ff4500", "85,135": "ff4500", "86,135": "c21138", "87,135": "ff4500", "88,135": "ff4500", "89,135": "ff4500", "90,135": "ff4500", "91,135": "c21138", "92,135": "ff4500", "93,135": "ff4500", "94,135": "c21138", "95,135": "ff4500", "96,135": "ff4500", "97,135": "c21138", "98,135": "ff4500", "99,135": "ff4500", "100,135": "ff4500", "101,135": "c21138", "102,135": "ff4500", "103,135": "ff4500", "104,135": "ff4500", "105,135": "c21138", "106,135": "ff4500", "107,135": "ff4500", "108,135": "c21138", "109,135": "ff4500", "110,135": "ff4500", "111,135": "ff4500", "112,135": "00a368", "113,135": "00a368", "114,135": "00a368", "115,135": "00a368", "116,135": "00a368", "117,135": "00a368", "118,135": "00a368", "119,135": "00a368", "120,135": "00a368", "121,135": "00a368", "122,135": "00a368", "123,135": "00a368", "124,135": "000000", "125,135": "000000", "126,135": "000000", "127,135": "000000", "128,135": "000000", "129,135": "000000", "130,135": "000000", "81,136": "00a368", "82,136": "00a368", "83,136": "ff4500", "84,136": "ff4500", "85,136": "ff4500", "86,136": "c21138", "87,136": "c21138", "88,136": "ff4500", "89,136": "c21138", "90,136": "ff4500", "91,136": "ff4500", "92,136": "ff4500", "93,136": "ff4500", "94,136": "ff4500", "95,136": "ff4500", "96,136": "ff4500", "97,136": "ff4500", "98,136": "ff4500", "99,136": "c21138", "100,136": "c21138", "101,136": "ff4500", "102,136": "ff4500", "103,136": "ff4500", "104,136": "c21138", "105,136": "ff4500", "106,136": "ff4500", "107,136": "ff4500", "108,136": "c21138", "109,136": "ff4500", "110,136": "c21138", "111,136": "ff4500", "112,136": "ff4500", "113,136": "ff4500", "114,136": "c21138", "115,136": "00a368", "116,136": "00a368", "117,136": "00a368", "118,136": "00a368", "119,136": "00a368", "120,136": "00a368", "121,136": "00a368", "122,136": "00a368", "123,136": "00a368", "124,136": "000000", "125,136": "ffd635", "126,136": "ffd635", "127,136": "ffd635", "128,136": "ffd635", "129,136": "000000", "130,136": "000000", "67,137": "000000", "68,137": "000000", "69,137": "000000", "70,137": "000000", "71,137": "000000", "72,137": "000000", "73,137": "00a368", "74,137": "00a368", "75,137": "00a368", "76,137": "00a368", "77,137": "00a368", "78,137": "00a368", "79,137": "00a368", "80,137": "00a368", "81,137": "00a368", "82,137": "00a368", "83,137": "00a368", "84,137": "ff4500", "85,137": "c21138", "86,137": "c21138", "87,137": "c21138", "88,137": "ff4500", "89,137": "c21138", "90,137": "ff4500", "91,137": "ff4500", "92,137": "ff4500", "93,137": "c21138", "94,137": "ff4500", "95,137": "ff4500", "96,137": "c21138", "97,137": "ff4500", "98,137": "c21138", "99,137": "c21138", "100,137": "c21138", "101,137": "c21138", "102,137": "c21138", "103,137": "00a368", "104,137": "00a368", "105,137": "00a368", "106,137": "00a368", "107,137": "c21138", "108,137": "ff4500", "109,137": "c21138", "110,137": "ff4500", "111,137": "c21138", "112,137": "ff4500", "113,137": "ff4500", "114,137": "ff4500", "115,137": "ff4500", "116,137": "00a368", "117,137": "00a368", "118,137": "00a368", "119,137": "00a368", "120,137": "00a368", "121,137": "00a368", "122,137": "00a368", "123,137": "00a368", "124,137": "000000", "125,137": "000000", "126,137": "000000", "127,137": "000000", "128,137": "000000", "129,137": "ffd635", "130,137": "000000", "67,138": "000000", "68,138": "000000", "69,138": "000000", "70,138": "000000", "71,138": "000000", "72,138": "000000", "73,138": "00a368", "74,138": "00a368", "75,138": "00a368", "76,138": "00a368", "77,138": "00a368", "78,138": "00a368", "79,138": "00a368", "80,138": "00a368", "81,138": "00a368", "82,138": "00a368", "83,138": "00a368", "84,138": "ff4500", "85,138": "00a368", "86,138": "00a368", "87,138": "00a368", "88,138": "c21138", "89,138": "ff4500", "90,138": "ff4500", "91,138": "ff4500", "92,138": "ff4500", "93,138": "c21138", "94,138": "00a368", "95,138": "00a368", "96,138": "00a368", "97,138": "c21138", "98,138": "c21138", "99,138": "c21138", "100,138": "ff4500", "101,138": "ff4500", "102,138": "ff4500", "103,138": "ff4500", "104,138": "00a368", "105,138": "00a368", "106,138": "00a368", "107,138": "00a368", "108,138": "00a368", "109,138": "00a368", "110,138": "00a368", "111,138": "00a368", "112,138": "c21138", "113,138": "ff4500", "114,138": "ff4500", "115,138": "00a368", "116,138": "ff4500", "117,138": "00a368", "118,138": "00a368", "119,138": "00a368", "120,138": "00a368", "121,138": "00a368", "122,138": "00a368", "123,138": "00a368", "124,138": "000000", "125,138": "000000", "126,138": "000000", "127,138": "ffd635", "128,138": "ffd635", "129,138": "000000", "130,138": "000000", "67,139": "000000", "68,139": "000000", "69,139": "000000", "70,139": "000000", "71,139": "000000", "72,139": "000000", "73,139": "00a368", "74,139": "000000", "75,139": "000000", "76,139": "000000", "77,139": "00a368", "78,139": "00a368", "79,139": "00a368", "80,139": "00a368", "81,139": "00a368", "82,139": "00a368", "83,139": "00a368", "84,139": "00a368", "85,139": "00a368", "86,139": "00a368", "87,139": "c21138", "88,139": "ff4500", "89,139": "ff4500", "90,139": "ff4500", "91,139": "00a368", "92,139": "ff4500", "93,139": "00a368", "94,139": "00a368", "95,139": "00a368", "96,139": "00a368", "97,139": "00a368", "98,139": "c21138", "99,139": "c21138", "100,139": "c21138", "101,139": "ff4500", "102,139": "ff4500", "103,139": "ff4500", "104,139": "ff4500", "105,139": "c21138", "106,139": "00a368", "107,139": "00a368", "108,139": "00a368", "109,139": "00a368", "110,139": "00a368", "111,139": "00a368", "112,139": "00a368", "113,139": "c21138", "114,139": "ff4500", "115,139": "00a368", "116,139": "00a368", "117,139": "00a368", "118,139": "00a368", "119,139": "00a368", "120,139": "00a368", "121,139": "00a368", "122,139": "00a368", "123,139": "00a368", "124,139": "000000", "125,139": "000000", "126,139": "000000", "127,139": "000000", "128,139": "000000", "129,139": "ffd635", "130,139": "000000", "67,140": "000000", "68,140": "000000", "69,140": "ffffff", "70,140": "ffffff", "71,140": "000000", "72,140": "000000", "73,140": "000000", "74,140": "ff4500", "75,140": "ff4500", "76,140": "000000", "77,140": "000000", "78,140": "00a368", "79,140": "00a368", "80,140": "00a368", "81,140": "ff4500", "82,140": "00a368", "83,140": "00a368", "84,140": "00a368", "85,140": "00a368", "86,140": "00a368", "87,140": "c21138", "88,140": "ff4500", "89,140": "ff4500", "90,140": "00a368", "91,140": "00a368", "92,140": "00a368", "93,140": "00a368", "94,140": "ff4500", "95,140": "c21138", "96,140": "00a368", "97,140": "00a368", "98,140": "00a368", "99,140": "00a368", "100,140": "c21138", "101,140": "ff4500", "102,140": "ff4500", "103,140": "ff4500", "104,140": "c21138", "105,140": "00a368", "106,140": "00a368", "107,140": "ff4500", "108,140": "00a368", "109,140": "00a368", "110,140": "00a368", "111,140": "00a368", "112,140": "00a368", "113,140": "c21138", "114,140": "ff4500", "115,140": "00a368", "116,140": "00a368", "117,140": "00a368", "118,140": "00a368", "119,140": "00a368", "120,140": "00a368", "121,140": "00a368", "122,140": "00a368", "123,140": "00a368", "124,140": "000000", "125,140": "ffd635", "126,140": "ffd635", "127,140": "ffd635", "128,140": "ffd635", "129,140": "000000", "130,140": "000000", "67,141": "000000", "68,141": "ffffff", "69,141": "ffffff", "70,141": "ffffff", "71,141": "ffffff", "72,141": "000000", "73,141": "ff4500", "74,141": "ff4500", "75,141": "ff4500", "76,141": "ff4500", "77,141": "000000", "78,141": "00a368", "79,141": "00a368", "80,141": "00a368", "81,141": "00a368", "82,141": "c21138", "83,141": "00a368", "84,141": "00a368", "85,141": "ff4500", "86,141": "ff4500", "87,141": "ff4500", "88,141": "ff4500", "89,141": "00a368", "90,141": "00a368", "91,141": "00a368", "92,141": "00a368", "93,141": "00a368", "94,141": "00a368", "95,141": "00a368", "96,141": "ff4500", "97,141": "00a368", "98,141": "00a368", "99,141": "c21138", "100,141": "ff4500", "101,141": "ff4500", "102,141": "ff4500", "103,141": "c21138", "104,141": "00a368", "105,141": "00a368", "106,141": "00a368", "107,141": "00a368", "108,141": "c21138", "109,141": "00a368", "110,141": "00a368", "111,141": "00a368", "112,141": "ff4500", "113,141": "ff4500", "114,141": "ff4500", "115,141": "00a368", "116,141": "00a368", "117,141": "00a368", "118,141": "00a368", "119,141": "00a368", "120,141": "00a368", "121,141": "00a368", "122,141": "00a368", "123,141": "00a368", "124,141": "000000", "125,141": "000000", "126,141": "000000", "127,141": "000000", "128,141": "000000", "129,141": "000000", "130,141": "000000", "67,142": "000000", "68,142": "ffffff", "69,142": "ff4500", "70,142": "ff4500", "71,142": "ffffff", "72,142": "000000", "73,142": "ffffff", "74,142": "ffffff", "75,142": "ffffff", "76,142": "ffffff", "77,142": "000000", "78,142": "00a368", "79,142": "00a368", "80,142": "ff4500", "81,142": "c21138", "82,142": "ff4500", "83,142": "ff4500", "84,142": "ff4500", "85,142": "ff4500", "86,142": "ff4500", "87,142": "c21138", "88,142": "00a368", "89,142": "00a368", "90,142": "00a368", "91,142": "00a368", "92,142": "00a368", "93,142": "ff4500", "94,142": "c21138", "95,142": "ff4500", "96,142": "ff4500", "97,142": "ff4500", "98,142": "ff4500", "99,142": "ff4500", "100,142": "ff4500", "101,142": "ff4500", "102,142": "c21138", "103,142": "00a368", "104,142": "00a368", "105,142": "00a368", "106,142": "ff4500", "107,142": "c21138", "108,142": "ff4500", "109,142": "ff4500", "110,142": "ff4500", "111,142": "ff4500", "112,142": "ff4500", "113,142": "ff4500", "114,142": "c21138", "115,142": "00a368", "116,142": "00a368", "117,142": "00a368", "118,142": "00a368", "119,142": "00a368", "120,142": "00a368", "121,142": "00a368", "122,142": "00a368", "123,142": "00a368", "124,142": "000000", "125,142": "000000", "126,142": "000000", "127,142": "ffd635", "128,142": "000000", "129,142": "000000", "130,142": "000000", "67,143": "000000", "68,143": "00a368", "69,143": "00a368", "70,143": "00a368", "71,143": "00a368", "72,143": "000000", "73,143": "ffffff", "74,143": "ffd635", "75,143": "ffd635", "76,143": "ffffff", "77,143": "000000", "78,143": "00a368", "79,143": "00a368", "80,143": "00a368", "81,143": "ff4500", "82,143": "c21138", "83,143": "c21138", "84,143": "ff4500", "85,143": "c21138", "86,143": "c21138", "87,143": "ff4500", "88,143": "ff4500", "89,143": "00a368", "90,143": "00a368", "91,143": "00a368", "92,143": "00a368", "93,143": "00a368", "94,143": "00a368", "95,143": "c21138", "96,143": "ff4500", "97,143": "ff4500", "98,143": "c21138", "99,143": "c21138", "100,143": "ff4500", "101,143": "00a368", "102,143": "00a368", "103,143": "00a368", "104,143": "00a368", "105,143": "00a368", "106,143": "00a368", "107,143": "00a368", "108,143": "c21138", "109,143": "ff4500", "110,143": "ff4500", "111,143": "c21138", "112,143": "c21138", "113,143": "ff4500", "114,143": "ff4500", "115,143": "ff4500", "116,143": "00a368", "117,143": "00a368", "118,143": "00a368", "119,143": "00a368", "120,143": "00a368", "121,143": "00a368", "122,143": "00a368", "123,143": "00a368", "124,143": "000000", "125,143": "ffd635", "126,143": "ffd635", "127,143": "ffd635", "128,143": "ffd635", "129,143": "ffd635", "130,143": "000000", "67,144": "000000", "68,144": "000000", "69,144": "000000", "70,144": "00a368", "71,144": "00a368", "72,144": "000000", "73,144": "000000", "74,144": "000000", "75,144": "000000", "76,144": "000000", "77,144": "00a368", "78,144": "00a368", "79,144": "00a368", "80,144": "ff4500", "81,144": "c21138", "82,144": "ff4500", "83,144": "00a368", "84,144": "00a368", "85,144": "ff4500", "86,144": "00a368", "87,144": "00a368", "88,144": "c21138", "89,144": "ff4500", "90,144": "00a368", "91,144": "00a368", "92,144": "00a368", "93,144": "00a368", "94,144": "ff4500", "95,144": "ff4500", "96,144": "00a368", "97,144": "00a368", "98,144": "ff4500", "99,144": "00a368", "100,144": "00a368", "101,144": "c21138", "102,144": "c21138", "103,144": "ff4500", "104,144": "00a368", "105,144": "00a368", "106,144": "00a368", "107,144": "ff4500", "108,144": "ff4500", "109,144": "00a368", "110,144": "00a368", "111,144": "ff4500", "112,144": "00a368", "113,144": "00a368", "114,144": "00a368", "115,144": "c21138", "116,144": "ff4500", "117,144": "00a368", "118,144": "00a368", "119,144": "00a368", "120,144": "00a368", "121,144": "00a368", "122,144": "00a368", "123,144": "00a368", "124,144": "000000", "125,144": "000000", "126,144": "000000", "127,144": "ffd635", "128,144": "000000", "129,144": "000000", "130,144": "000000", "67,145": "000000", "68,145": "000000", "69,145": "000000", "70,145": "000000", "71,145": "00a368", "72,145": "000000", "73,145": "000000", "74,145": "000000", "75,145": "000000", "76,145": "00a368", "77,145": "00a368", "78,145": "00a368", "79,145": "00a368", "80,145": "00a368", "81,145": "00a368", "82,145": "00a368", "83,145": "00a368", "84,145": "00a368", "85,145": "00a368", "86,145": "00a368", "87,145": "00a368", "88,145": "00a368", "89,145": "00a368", "90,145": "00a368", "91,145": "00a368", "92,145": "00a368", "93,145": "00a368", "94,145": "00a368", "95,145": "00a368", "96,145": "00a368", "97,145": "00a368", "98,145": "00a368", "99,145": "00a368", "100,145": "00a368", "101,145": "00a368", "102,145": "00a368", "103,145": "00a368", "104,145": "00a368", "105,145": "00a368", "106,145": "00a368", "107,145": "00a368", "108,145": "00a368", "109,145": "00a368", "110,145": "00a368", "111,145": "00a368", "112,145": "00a368", "113,145": "00a368", "114,145": "00a368", "115,145": "00a368", "116,145": "00a368", "117,145": "00a368", "118,145": "00a368", "119,145": "00a368", "120,145": "00a368", "121,145": "00a368", "122,145": "00a368", "123,145": "00a368", "124,145": "000000", "125,145": "000000", "126,145": "000000", "127,145": "000000", "128,145": "000000", "129,145": "000000", "130,145": "000000", "67,146": "000000", "68,146": "000000", "69,146": "000000", "70,146": "000000", "71,146": "000000", "72,146": "000000", "73,146": "000000", "74,146": "000000", "75,146": "00a368", "76,146": "00a368", "77,146": "00a368", "78,146": "00a368", "79,146": "00a368", "80,146": "00a368", "81,146": "00a368", "82,146": "00a368", "83,146": "00a368", "84,146": "00a368", "85,146": "00a368", "86,146": "00a368", "87,146": "00a368", "88,146": "00a368", "89,146": "00a368", "90,146": "00a368", "91,146": "00a368", "92,146": "00a368", "93,146": "00a368", "94,146": "00a368", "95,146": "00a368", "96,146": "00a368", "97,146": "00a368", "98,146": "00a368", "99,146": "00a368", "100,146": "00a368", "101,146": "00a368", "102,146": "00a368", "103,146": "00a368", "104,146": "00a368", "105,146": "00a368", "106,146": "00a368", "107,146": "00a368", "108,146": "00a368", "109,146": "00a368", "110,146": "00a368", "111,146": "00a368", "112,146": "00a368", "113,146": "00a368", "114,146": "00a368", "115,146": "00a368", "116,146": "00a368", "117,146": "00a368", "118,146": "00a368", "119,146": "00a368", "120,146": "00a368", "121,146": "00a368", "122,146": "00a368", "123,146": "00a368", "124,146": "000000", "125,146": "000000", "126,146": "000000", "127,146": "000000", "128,146": "000000", "129,146": "000000", "130,146": "000000", "67,147": "000000", "68,147": "000000", "69,147": "000000", "70,147": "000000", "71,147": "000000", "72,147": "000000", "73,147": "000000", "74,147": "000000", "75,147": "000000", "76,147": "000000", "77,147": "000000", "78,147": "000000", "79,147": "000000", "80,147": "000000", "81,147": "000000", "82,147": "000000", "83,147": "000000", "84,147": "000000", "85,147": "000000", "86,147": "000000", "87,147": "000000", "88,147": "000000", "89,147": "000000", "90,147": "000000", "91,147": "000000", "92,147": "000000", "93,147": "000000", "94,147": "000000", "95,147": "000000", "96,147": "000000", "97,147": "000000", "98,147": "000000", "99,147": "000000", "100,147": "000000", "101,147": "000000", "102,147": "000000", "103,147": "000000", "104,147": "000000", "105,147": "000000", "106,147": "000000", "107,147": "000000", "108,147": "000000", "109,147": "000000", "110,147": "000000", "111,147": "000000", "112,147": "000000", "113,147": "000000", "114,147": "000000", "115,147": "000000", "116,147": "000000", "117,147": "000000", "118,147": "000000", "119,147": "000000", "120,147": "000000", "121,147": "000000", "122,147": "000000", "123,147": "000000", "124,147": "000000", "125,147": "000000", "126,147": "000000", "127,147": "000000", "128,147": "000000", "129,147": "000000", "130,147": "000000"}
let start_x = 74;
let start_y = 117;
let flag_length = 57;
let flag_height = 30;
function authorize(code, refresh) {
fetch("https://www.reddit.com/api/v1/access_token", {
"method": "POST",
"body": `grant_type=${refresh ? 'refresh_token' : 'authorization_code'}&${refresh ? 'refresh_token' : 'code'}=${code}&redirect_uri=https%3A%2F%2Frhld16.duckdns.org%2Fcymru.html`,
"headers": {
"Authorization": "Basic " + btoa("6IhoFWZ-KKMicj85PWnU9Q:"),
"Content-Type": "application/x-www-form-urlencoded"
},
}).then(res => res.json()).then(res => {
console.log(res)
if (res.error != null) {
localStorage.removeItem('token');
document.getElementById("token").innerHTML = 'Error: ' + res.error;
let url = `https://www.reddit.com/api/v1/authorize?client_id=6IhoFWZ-KKMicj85PWnU9Q&response_type=code&state=RANDOM_STRING&redirect_uri=https%3A%2F%2Frhld16.duckdns.org%2Fcymru.html&duration=permanent&scope=edit%20vote%20identity%20privatemessages%20mysubreddits%20read%20submit%20subscribe`
window.location.href = url;
} else {
localStorage.setItem("token", res.access_token);
localStorage.setItem("refresh_token", res.refresh_token);
localStorage.setItem("expiry_timestamp", Date.now() + res.expires_in * 1000);
document.getElementById("token").innerHTML = res.access_token;
document.getElementById("time").innerHTML = 'Time until next tile place: Loading...'
setTimeout(() => {
authorize(res.refresh_token, true);
}, 3500 * 1000);
}
});
}
if (localStorage.getItem("token") != null && !localStorage.getItem("token").startsWith("Bearer") && localStorage.getItem("token").length > 0) {
if (Date.now() > localStorage.getItem("expiry_timestamp")) {
authorize(localStorage.getItem("refresh_token"), true);
} else {
document.getElementById("token").value = localStorage.getItem("token");
document.getElementById("time").value = 'Time until next tile place: Loading...'
setTimeout(() => {
authorize(localStorage.getItem("refresh_token"), true);
}, 3500 * 1000);
}
} else {
let urlParams = new URLSearchParams(window.location.search);
let code = urlParams.get('code');
if (code != null) {
authorize(code, false);
} else {
let url = `https://www.reddit.com/api/v1/authorize?client_id=6IhoFWZ-KKMicj85PWnU9Q&response_type=code&state=RANDOM_STRING&redirect_uri=https%3A%2F%2Frhld16.duckdns.org%2Fcymru.html&duration=permanent&scope=edit%20vote%20identity%20privatemessages%20mysubreddits%20read%20submit%20subscribe`
window.location.href = url;
}
}
function getColor(x, y) {
let hex = pixels[`${x},${y}`]
if (hex == 'ff4500') return 2 // light red
if (hex == '808080') return 2 // light red
if (hex == '00a368') return 6 // green
if (hex == 'c21138') return 1 // dark red
if (hex == 'ffffff') return 31 // white
if (hex == 'ffa728') return 3 // orange
if (hex == 'ffff00') return 4 // yellow
if (hex == '000000') return 27 // black
else return hex //
}
let version = 20;
document.getElementById("version").innerHTML = 'Version: ' + version;
setInterval(() => {
fetch("version").then(res => res.text()).then(res => {
if (res > version) {
window.location.reload();
}
});
}, 60 * 1000);
setInterval(loop, 5000);
loop();
function loop() {
if (localStorage.getItem("token") != null) {
var token = localStorage.getItem("token");
if (token != null) {
fetch("https://cors-anywhere-production-da91.up.railway.app/https://gql-realtime-2.reddit.com/query", {
"headers": {
"accept": "*",
"accept-language": "en,cy;q=0.9",
"apollographql-client-name": "mona-lisa",
"apollographql-client-version": "0.0.1",
"authorization": "Bearer " + token,
"cache-control": "no-cache",
"content-type": "application/json",
"pragma": "no-cache",
"x-requested-with": "placebot"
},
"referrer": "https://hot-potato.reddit.com/",
"body": "{\"operationName\":\"getUserCooldown\",\"variables\":{\"input\":{\"actionName\":\"r/replace:get_user_cooldown\"}},\"query\":\"mutation getUserCooldown($input: ActInput!) {\\n act(input: $input) {\\n data {\\n ... on BasicMessage {\\n id\\n data {\\n ... on GetUserCooldownResponseMessageData {\\n nextAvailablePixelTimestamp\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n}\\n\"}",
"method": "POST"
}).then(response => response.json()).then(body => {
if (body.error != undefined && body.error.reason == "UNAUTHORIZED") {
authorize(localStorage.getItem("refresh_token"), true);
return
}
var nextAvailablePixelTimestamp = body.data.act.data[0].data.nextAvailablePixelTimestamp;
if (nextAvailablePixelTimestamp != null) {
var time = nextAvailablePixelTimestamp - Date.now();
document.getElementById("time").innerHTML = `Time until next tile place: ${(time / 1000).toFixed(0)} seconds`;
} else {
function rgbtohex(r, g, b) {
return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
}
document.getElementById("time").innerHTML = `Time until next tile place: NOW!`;
let image = fetch("https://carnelian-meteor-addition.glitch.me/image?access_token=" + token).then(res => res.blob()).then(blob => {
var img = new Image();
img.src = URL.createObjectURL(blob);
img.onload = function() {
var canvas = document.createElement('canvas');
canvas.width = img.width;
canvas.height = img.height;
var ctx = canvas.getContext('2d');
console.log(ctx.getImageData(101, 124, 1, 1).data);
ctx.drawImage(img, 0, 0);
var x = Math.floor(Math.random() * img.width);
var y = Math.floor(Math.random() * img.height);
console.log(pixels[`${x},${y}`], rgbtohex(ctx.getImageData(x, y, 1, 1).data[0], ctx.getImageData(x, y, 1, 1).data[1], ctx.getImageData(x, y, 1, 1).data[2]));
while (pixels[`${x},${y}`] == undefined || pixels[`${x},${y}`] == rgbtohex(ctx.getImageData(x, y, 1, 1).data[0], ctx.getImageData(x, y, 1, 1).data[1], ctx.getImageData(x, y, 1, 1).data[2])) {
x = Math.floor(Math.random() * img.width);
y = Math.floor(Math.random() * img.height);
console.log(pixels[`${x},${y}`], rgbtohex(ctx.getImageData(x, y, 1, 1).data[0], ctx.getImageData(x, y, 1, 1).data[1], ctx.getImageData(x, y, 1, 1).data[2]));
}
console.log(pixels[`${x},${y}`], rgbtohex(ctx.getImageData(x, y, 1, 1).data[0], ctx.getImageData(x, y, 1, 1).data[1], ctx.getImageData(x, y, 1, 1).data[2]));
setPixel(x, y, getColor(x, y));
}
});
}
})
}
}
}
function setPixel(x, y, color) {
fetch("https://cors-anywhere-production-da91.up.railway.app/https://gql-realtime-2.reddit.com/query", {
"headers": {
"accept": "*",
"accept-language": "en,cy;q=0.9",
"apollographql-client-name": "mona-lisa",
"apollographql-client-version": "0.0.1",
"authorization": "Bearer " + localStorage.getItem("token"),
"cache-control": "no-cache",
"content-type": "application/json",
"pragma": "no-cache",
"x-requested-with": "placebot"
},
"referrer": "https://hot-potato.reddit.com/",
"body": "{\"operationName\":\"setPixel\",\"variables\":{\"input\":{\"actionName\":\"r/replace:set_pixel\",\"PixelMessageData\":{\"coordinate\":{\"x\":" + x + ",\"y\":" + y + "},\"colorIndex\":" + color + ",\"canvasIndex\":0}}},\"query\":\"mutation setPixel($input: ActInput!) {\\n act(input: $input) {\\n data {\\n ... on BasicMessage {\\n id\\n data {\\n ... on GetUserCooldownResponseMessageData {\\n nextAvailablePixelTimestamp\\n __typename\\n }\\n ... on SetPixelResponseMessageData {\\n timestamp\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n}\\n\"}",
"method": "POST",
}).then(response => response.json()).then(body => {
console.log(body)
var name_map = {
1: "Dark Red",
2: "Bright Red",
3: "Orange",
4: "Yellow",
6: "Dark Green",
7: "Green",
8: "Light Green",
9: "Dark Teal",
10: "Teal",
12: "Dark Blue",
13: "Blue",
14: "Light Blue",
15: "Indigo",
16: "Periwinkle",
18: "Dark Purple",
19: "Purple",
22: "Pink",
23: "Light Pink",
24: "Dark Brown",
25: "Brown",
27: "Black",
29: "Gray",
30: "Light Gray",
31: "White"
}
var color_name = name_map[color];
var log = document.getElementById("log");
var new_log = document.createElement("div");
new_log.innerHTML = `${new Date().toLocaleString()} - Set ${x}, ${y} to ${color_name}`;
log.appendChild(new_log);
fetch('https://discord.com/api/webhooks/960152717328793600/ziXcQW-Zcge7LIy2YWxjdK50T0cun7z1vTK2Z0htkLCXh-BUYeTbEPwUXkrjjSB89HTk', {
method: 'post',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
content: `${new Date().toLocaleString()} - Set ${x}, ${y} to ${color_name} - Version ${version}`
}),
});
});
}
function getAllIncorrectPixels(image) {
var canvas = document.createElement('canvas');
canvas.width = image.width;
canvas.height = image.height;
var ctx = canvas.getContext('2d');
ctx.drawImage(image, 0, 0);
for (var x = 0; x < image.width; x++) {
for (var y = 0; y < image.height; y++) {
var color = rgbtohex(ctx.getImageData(x, y, 1, 1).data[0], ctx.getImageData(x, y, 1, 1).data[1], ctx.getImageData(x, y, 1, 1).data[2]);
if (color != pixels[`${x},${y}`]) {
console.log(x, y, color, getColor(x, y));
}
}
}
}
</script>
</body>
</html>