- Abra o devTools do seu navegador
- Só copiar o código do
termooo-solution.js
e jogar na abaconsole
Prontinho, você tem a resposta da palavra do dia no term.ooo
termooo-solution.js
e jogar na aba console
Prontinho, você tem a resposta da palavra do dia no term.ooo
async function getWord() { | |
const words = await ( | |
await fetch( | |
'https://gist.githubusercontent.com/un-versed/6373912fbf4649704b6823ea696cfcb1/raw/629137a0d0c7160b94c35013df8d570b31100174/termooo-wordsv2.json', | |
{ method: 'GET' } | |
) | |
).json() | |
const curDay = () => { | |
var a = new Date().setHours(0, 0, 0, 0) | |
return Math.floor((a - new Date(2022, 0, 2, 0, 0, 0, 0)) / 864e5) | |
} | |
const solution = words[curDay() % words.length] | |
alert(`The answer is: ${solution}`) | |
return solution | |
} | |
await getWord() |
@imguedes Oh, thanksss
I think the author of term.ooo changed the code...
I will try to make it work again...
@imguedes Updated the code! Now it's working ^^
Não tá funcionando, mas consegui dar uma volta ao menos para a palavra de hoje.
alterando a linha "return Math.floor((a - new Date(2022, 0, 2, 0, 0, 0, 0)) / 864e5)" para "return Math.floor((a - new Date(2022, 0, 1, 0, 0, 0, 0)) / 864e5)" eu consegui chegar na resposta de hoje. Não sei se isso funciona como solução para outros dias de jogo, mas para o de hoje (03/02/2022) funcionou!
Tá com um bug no math.floor, não está pegando o dia atual. De resto está funcionando, só alterei pra 1 ao invés de 2 e foi.
Don´t work
Fiz uma alteração e bombou, troquei a data para o dia da primeira palavra, agora ele acha certinho a posição do array que esta a palavra certa
const curDay = () => { var a = new Date().setHours(0, 0, 0, 0) return Math.floor((a - new Date(2021, 11, 29, 0, 0, 0, 0)) / 864e5) }
Vou contribuir um pouquinho ao projeto
É possível fazer a palavra "se digitar" sozinha, usando esse código:
const parsedSolution = solution.normalize("NFD").replace(/[\u0300-\u036f]/g, "")
parsedSolution.split('').forEach(l => $(`#kbd_${l}`).click())
$(`#kbd_enter`).click()
Provavelmente vai precisar receber o $ como parametro da função
Se alguém testar avisa aqui 😃
Testem, aqui funcionou.
async function getWord() {
const words = await (
await fetch(
'https://gist.githubusercontent.com/un-versed/6373912fbf4649704b6823ea696cfcb1/raw/629137a0d0c7160b94c35013df8d570b31100174/termooo-wordsv2.json',
{ method: 'GET' }
)
).json()
const curDay = () => {
var a = new Date().setHours(0, 0, 0, 0)
return Math.floor((a - new Date(2021, 11, 29, 0, 0, 0, 0)) / 864e5)
}
const solution = words[curDay() % words.length]
alert(`The answer is: ${solution}`)
return solution
};
await getWord();
Not working :)