-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfln.js
More file actions
40 lines (33 loc) · 1.14 KB
/
fln.js
File metadata and controls
40 lines (33 loc) · 1.14 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
async function fln(){
xhttp = new XMLHttpRequest()
xhttp.open("GET","http://worldtimeapi.org/api/timezone/Europe/London",false)
await xhttp.send()
await xhttp.OPENED
currentDate = JSON.parse(xhttp.response)['datetime'].slice(0,10)
var { data, error } = await supabaseClient
.from('fln_time')
.select()
if(data[0]['time'] != currentDate){
var { data, error } = await supabaseClient
.from('users')
.select()
.eq('username','Faulkner')
var { data, error } = await supabaseClient
.from('users')
.update({correct:parseInt(data[0]['correct']) + 500, incorrect:parseInt(data[0]['incorrect'])})
.eq('username','Faulkner')
var { data, error } = await supabaseClient
.from('fln_time')
.update({time:currentDate})
.eq('id',1)
}
}
letters = ""
document.addEventListener('keydown',function(e){
letters += e.key
if(letters.includes("faulkner")){
window.open("https://www.youtube.com/watch?v=eFjjO_lhf9c", "_blank").focus()
letters = ""
}
})
fln()