Created
February 27, 2023 15:05
-
-
Save oliverswitzer/b96265539c4760cbd5a873bd3cc2fde4 to your computer and use it in GitHub Desktop.
ChatGPT Browser Script: Use this to programmatically ask ChatGPT questions
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
SCRIPT TO TALK TO GPT3 | |
const prompt = "why am I getting this error" // change me | |
let button = document.querySelectorAll("button")[5]; | |
let textarea = document.querySelector("textarea"); | |
textarea.innerText = prompt; | |
button.dispatchEvent(new Event("click", {bubbles: true})) | |
const getResults = () => [...document.querySelectorAll('.markdown.prose')] | |
const printLastResult = () => { | |
const results = getResults() | |
console.log(results[results.length - 1].innerText) | |
} | |
const printInterval = setInterval(() => printLastResult(), 1000) | |
setTimeout(() => clearInterval(printInterval), 15000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment