Last active
May 18, 2023 06:29
-
-
Save a13ks3y/ed4b751832d5bc7a9931694218fd513c to your computer and use it in GitHub Desktop.
Very basic ChatGPT autoresponder.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loop() { | |
if (loop.__lock) return; loop.__lock = true; | |
const btnEl = document.querySelector('button.absolute'); | |
const inputEl = document.querySelector('#prompt-textarea'); | |
const responseEl = document.querySelector("#__next > div.overflow-hidden.w-full.h-full.relative.flex.z-0 > div.relative.flex.h-full.max-w-full.flex-1.overflow-hidden > div > main > div.flex-1.overflow-hidden > div > div > div > div:nth-last-child(2)"); | |
const response = responseEl ? responseEl.textContent : 'Sorry got distracted, where did we stop?'; | |
const isItAQuestion = /(.*)\?/gi.test(response); | |
const request = isItAQuestion ? response : 'Ask me a question, according to my previous reply:\n\n' + response; | |
inputEl.value = request; | |
btnEl.removeAttribute('disabled'); | |
btnEl.click(); | |
setTimeout(() => loop.__lock = false, 60000); | |
if (isNaN(loop.__interval)) loop.__interval = setInterval(loop, 66666); | |
console.log('To stop it run:', 'clearInterval(loop.__interval)', 'or just reload the page'); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is just example of how to implement an infinite loop of noncence.
Just copy paste it to the javascript console while you on ChatGPT tab and call loop() when you ready.
Use it on own risk, openai could ban your account for using such approach, this exmple is just a proof-of-concept, please use official API if you need something more complicated.