Generating GPT-3 Code#back to top


To generate code using machine learning, click "Generate GPT" and write using natural words what you want the script to do.
For example, "collects all the links on the page and sends them to google sheets."





How To Edit Our Scripts Or Write Your Own#back to top


Hover over the "Run" button on any script and click "Edit" to edit any script. You can also click the handwriting button next to CheatLayer to open the editor for a new script.




Scheduling Scripts #back to top

If you want to schedule scripts to run hours/daily/weekly/monthly, hover over the "Run" button next to any script, then select the schedule option. Select the frequency you want to run it, and click schedule. You can remove scripts from the schedule by clicking th "remove" link under each.




Run Code On Multiple Tabs #back to top

The runOnTab built in library function allows running any script on any link. You can enter the name of a saved local script, or the code directly and it will open multiple links all at once and run the code on them.

					runOnTab(links[kk].href, 'ENTER CODE HERE')

                                      




Send Ajax To Any Webhook #back to top

Use the sendAjax function to send data to any REST API or webhook. For example, if you entered your zapier webhook above, cheatlayer will replace these placeholders with the correct webhook url to send data to google sheets in the code below!

sendAjax('GOOGLE_SHEETS_WEBHOOK',{keys:  headers[kk].innerText, data: window.location.href, index: kk},'post');

                                      




GPT Machine Learning Code Generation Examples #back to top

Generate a javascript code that collects all the links on the page and print them to the console in 5 seconds.

setTimeout(function(){
var links = document.getElementsByTagName('a');
console.log(links);
}, 5*1000);

                                      
Generate a javascript code that collects all the links on the page and saves it to TempA. Cheatlayer gives you a temporary storage that's propogated across pages to link scripts like this: }

var links = document.getElementsByTagName('a');
for(var kk = 0; kk < links.length; kk++){
sendAjax('https://cheatlayer.com/user/saveTemp',{tempA: links[kk].href, index: kk, text: links[kk].innerText},'post');
}
                                      
Generate a javascript code that finds a header on the page with an aria-label that includes 'JobInfoHeader-title' and send them to google sheets in 10 seconds.
setTimeout(function(){
var headers = document.getElementsByTagName('h1');
for(var kk = 0; kk < headers.length; kk++){
if(headers[kk].getAttribute('aria-label')  && headers[kk].getAttribute('aria-label').indexOf('JobInfoHeader-title') >= 0){
sendAjax('GOOGLE_SHEETS_WEBHOOK',{keys:  headers[kk].innerText, data: window.location.href, index: kk},'post');
}
}
}, 10*1000);
                                      
Generate a javascript code that collects all the links on the page with an id that includes 'job' and runs a script on them in 9 seconds.
setTimeout(function(){
var links = document.getElementsByTagName('a');
for(var kk = 0; kk < links.length; kk++){
if(links[kk].getAttribute('id')  && links[kk].getAttribute('id').indexOf('job') >= 0){
runOnTab(links[kk].href, 'ENTER CODE HERE')
}
}
}, 9*1000);
                                      




Download Images From Facebook#back to top


Use the script below to download images from facebook or any website!

images=document.querySelectorAll("img"); for (i of images) { 
if(i.src.indexOf('fav') == -1){
downloadFile(i.src);
}

}


                                      




Turn On Dark Mode On Any Website#back to top


Use the script below to turn on dark mode on any website! Paste it into the editor after clicking the handwriting icon, then click run.

function toggle() {
    let q = document.querySelectorAll('#nightify')
    if(q.length) {
        q[0].parentNode.removeChild(q[0])
        return false
    }
    var h = document.getElementsByTagName('head')[0],
        s = document.createElement('style');
    s.setAttribute('type', 'text/css');
    s.setAttribute('id', 'nightify');
    s.appendChild(document.createTextNode('html{-webkit-filter:invert(100%) hue-rotate(180deg) contrast(70%) !important; background: #fff;} .line-content {background-color: #fefefe;}'));
    h.appendChild(s); 
    return true
}

toggle() 

                                      




Scrape Google Search To Google Sheets#back to top


Use the script below to scrape google searches to google sheets! You can set your zapier integration URL on this page above at the setup section. The extension will then automatically replace placeholders with the correct URL in the GPT-3 generated code.

//Generated Script id=0
setTimeout(function(){
var links = document.getElementsByTagName('a');
for(var kk = 0; kk < links.length; kk++){
if(links[kk].getAttribute('href') && links[kk].getAttribute('href').indexOf('https') && links[kk].getAttribute('href').indexOf('.io') >= 0){
sendAjax('https://hooks.zapier.com/hooks/catch/1200171/bo2zk3y',{keys:  links[kk].innerText, data: window.location.href, index: kk},'post');
}
}
}, 10*1000);
//endcode
                                      




Get Data From Google Sheets #back to top

We can use the sendAjax function to send a request to any API, then run a script on the result using a callback. The final parameter to the send ajax function is the code to run as a callback, and you'll get the result of the Ajax request in the 'data' variable.
//get links from google sheets, then run a script on those links called 'shopify' also copied below
sendAjax("https://docs.google.com/spreadsheets/d/e/2PACX-1vR06z22kN1YYUwOjueDoFe9L7QQ9vVChu8lGEcOCXOi3tWrLg6qj-VwI6xGRN4DBqQiJQu0C0Cbwmsq/pub?output=csv",{},"GET", `console.log('CALLBACK');console.log(data.split('https'));
var splits = data.split('https');
for(var kk =0; kk < splits.length; kk++){
  //  if(splits[kk].includes('://')){
        if(kk < 10){
console.log("https://" + splits[kk]);
         runOnTab("https" + splits[kk], "shopify");
}    
//}
}


`);


                                      
//save this script as 'shopify' then run the script above. You can use script names OR code when using the built in runOnTab function

//Generated Script id=2
var links = document.getElementsByTagName('ul');
console.log(links);
for(var kk = 0; kk < links.length; kk++){
if(links[kk].getAttribute('class') && links[kk].getAttribute('class').indexOf('app-support-list') >= 0){
console.log(links[kk].innerHTML);
var page_links = "";
var links_array = links[kk].innerHTML.split('href="');
for(var jj =0; jj < links_array.length; jj++){
console.log(links_array[jj].split('"')[0]);
page_links += links_array[jj].split('"')[0] + ",";
}

console.log(links[kk].innerText);
console.log(page_links);
sendAjax('https://hooks.zapier.com/hooks/catch/1200171/bul7mc9/',{key:page_links, data: links[kk].innerText, index:links.length},'POST', 'console.log()');//endcode


}
}