(function() { // Array of random image URLs hosted online const imageUrls = [ 'https://files.catbox.moe/omyqyp.jpg', 'https://files.catbox.moe/6tccu4.jpeg', 'https://files.catbox.moe/9re67n.png', 'https://files.catbox.moe/dk014v.jpg', 'https://files.catbox.moe/rf93xb.png', 'https://files.catbox.moe/9cqtnw.jpg', 'https://files.catbox.moe/guncwx.jpg', 'https://files.catbox.moe/u1hcap.jpg', 'https://files.catbox.moe/xl0ixe.jpg', 'https://files.catbox.moe/75r5y2.jpg', 'https://files.catbox.moe/y1zerg.jpg', 'https://files.catbox.moe/8rew1e.jpg', 'https://files.catbox.moe/85jg30.png', 'https://files.catbox.moe/ii131e.jpeg', 'https://files.catbox.moe/5tq5mz.jpg' // Add more image URLs here ]; // Helper function to get a random item from an array function getRandomItem(arr) { return arr[Math.floor(Math.random() * arr.length)]; } // Function to generate a similar but randomized string to "baby" function generateRandomSimilarString(baseString = "baby") { const characters = 'abcdefghijklmnopqrstuvwxyz1234567890-=!@#$%^&*()_+'; const baseArray = baseString.split(''); const newArray = [...baseArray]; // Add two random letters for (let i = 0; i < 2; i++) { const randomChar = characters.charAt(Math.floor(Math.random() * characters.length)); newArray.splice(Math.floor(Math.random() * newArray.length), 0, randomChar); } // Remove two letters for (let i = 0; i < 2; i++) { newArray.splice(Math.floor(Math.random() * newArray.length), 1); } return newArray.join(''); } // Function to simulate a file drop on the dropzone async function simulateFileDrop() { const randomImageUrl = getRandomItem(imageUrls); const imageName = randomImageUrl.split('/').pop(); // Extract the file name from the URL // Fetch the image data const response = await fetch(randomImageUrl); if (!response.ok) { console.error('Failed to fetch image:', randomImageUrl); return; } const blob = await response.blob(); // Create a File object with the correct name and type const file = new File([blob], imageName, { type: blob.type }); // Create a DataTransfer object and add the file to it const dataTransfer = new DataTransfer(); dataTransfer.items.add(file); // Create a drop event const dropEvent = new DragEvent('drop', { dataTransfer: dataTransfer, bubbles: true, cancelable: true }); // Find the dropzone element and dispatch the drop event const dropzone = document.querySelector('.dropzone'); if (dropzone) { dropzone.dispatchEvent(dropEvent); console.log('File dropped successfully.'); } else { console.error('Dropzone element not found.'); } } // Function to populate the form fields automatically function populateForm() { // Find the text area and set random similar text let adj = ["crazy", "funny", "cute", "terrific", "insane", "happy", "reasonable", "sour", "sweet", "umami", "spicy", "mild", "minor", "major", "acceptable", "unacceptable", "hates", "loved", "favorite", "disliked", "gemmy", "coaly", "pristine", "dirty", "beautiful"] //Adj is an array of adjectives. noun is an array of nouns. verb is an array of verbs. let noun = ["spittoon", "cup", "bottle", "unicorn", "Spongebob Squarepants", "horse", "cat", "dog", "pig", "hamster", "leopord", "lion", "squirrel", "cheeseburger", "fries", "octopus", "fish", "orca", "seal", "sea urchin", "jellyfish", "Squidward Tentacles", "Sonic's Classic Chocolate Shake", "McDonald's", "Arby's Baconator"] let verb = ["plays", "runs", "throws", "walks", "talks", "screams", "whines", "speeds", "falls", "posts", "jumps", "flies", "squeals", "scuttles", "dislikes", "loves", "hates", "dips", "splashes", "swims", "sails", "flaps", "sings", "releases", "shuffles"] // Randomises the type of word. All arrays MUST be the same length as the "noun" array. let rand = Math.floor(Math.random() * noun.length) // Replaces the comment with the autogenerated text. const textArea = document.querySelector('textarea[name="body"]'); if (textArea) { textArea.value = verb[rand] + " " + adj[rand] + " " + noun[rand] + " " + verb[rand] + + " " + noun[rand] + " " + verb[rand] + " " + adj[rand] + " " + noun[rand] + " " + verb[rand] + " " + noun[rand] + " " + verb[rand] + " " + noun[rand] + " " + verb[rand] + " " + adj[rand] + " " + noun[rand] + " " + verb[rand] + " " + adj[rand] + " " + noun[rand] + " " + verb[rand] + " " + noun[rand] + " " + adj[rand] + " " + verb[rand] + " " + noun[rand] + " " + verb[rand] + " " + adj[rand] + " " + noun[rand] + " " + verb[rand] + " " + noun[rand] + " " + adj[rand] + " " + verb[rand] + " " + noun[rand] + " " + noun[rand] + " " + noun[rand] + " " + noun[rand] + " " + noun[rand]; // Generate similar string } // Simulate setting the image file simulateFileDrop(); // Click the submit button after 1 second setTimeout(() => { const submitButton = document.querySelector('input[name="post"]'); if (submitButton) { submitButton.click(); } else { console.error('Submit button not found.'); } }, 4000); // 1 second delay } // Set up a loop to repeat the process every 10 seconds setInterval(populateForm, 400); })();