JSFiddle - React, Tailwind, and code Playground
by devgarut
HTML
<label id="label" for="lname">ALL IN ONE CHATGPT</label><br><br>
<textarea id="prompt" name="lname" autocomplete="off" cols="100" rows="5" placeholder="Input prompt.. lalu klik send"></textarea><br><br>
<button onclick="sendRequest();" id="send" type="text" disabled>Send</button>
<br><br>
<div id="showdata">
Output
</div>
JavaScript
//INPUT EVALUSI
const idbutton = document.getElementById("send");
const textareaprompt = document.getElementById("prompt");
textareaprompt.addEventListener('input', () => {
idbutton.disabled = textareaprompt.value == '';
});
//INPUT EVALUASI
//FUNGSI MULAI SEND
function sendRequest(){
document.getElementById("send").disabled = true;
document.getElementById("showdata").innerText = "loading...";
document.getElementById("send").innerText = "...";
fetch("https://chatgpt.tetadigital.com/?&kata="+textareaprompt.value+"&bot=chatgptplus&cid=3632708", {
method: 'GET',
})
.then(response => {
if (!response.ok) {
return response.text().then(text => { throw new Error(text) })
}
return response.json()
})
.then(function(json) {
document.getElementById("send").disabled = false;
document.getElementById("send").innerText = "Send";
window.location.href="#showdata";
var jsonkunci = json.jsons
//alert(jsonkunci.tchannelData.minSeq)
var tetaid = jsonkunci.tchannelData.minSeq;
var tetahash= jsonkunci.tchannelData.channelHash;
var tetachannel= jsonkunci.tchannelData.channel;
var konci = json.koncina
var koncina = konci.data.messageEdgeCreate.message.node.messageId
//console.log(koncina)
var txoo = ""+koncina+""
var result2 = txoo.substr(0, 6);
koncid = [];
koncid.push(result2);
//PEMBUKA CONFIG WEBSOCKET
function konek_websocket(url, callsiap, konekcallback) {
let socket = new WebSocket(url);
socket.onopen = function() {
console.log('koneksi webSocket berhasil');
if (callsiap !== undefined) callsiap(this);
}
socket.onerror = function(e) {
console.error('WebSocket terjadi error');
...