Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function() {
- // Array of random image URLs from Catbox
- const imageUrls = [
- 'https://files.catbox.moe/6duawu.png',
- 'https://files.catbox.moe/grz6rr.png',
- 'https://files.catbox.moe/k1h5xa.png',
- 'https://files.catbox.moe/n1x0cw.png',
- 'https://files.catbox.moe/jhzncd.png',
- 'https://files.catbox.moe/aziy5r.png',
- 'https://files.catbox.moe/w14ev1.png',
- 'https://files.catbox.moe/qjfppr.png',
- 'https://files.catbox.moe/y6uk9a.png',
- 'https://files.catbox.moe/u47zuz.png',
- 'https://files.catbox.moe/ilgg4s.png',
- 'https://files.catbox.moe/5gvcbf.png',
- 'https://files.catbox.moe/9h7n2o.png',
- 'https://files.catbox.moe/t94b16.png',
- 'https://files.catbox.moe/5nhfnd.png',
- 'https://files.catbox.moe/q611x8.png',
- 'https://files.catbox.moe/llfe6u.png',
- 'https://files.catbox.moe/xofz8h.png',
- 'https://files.catbox.moe/oo1dyf.png',
- 'https://files.catbox.moe/wagnv8.png',
- 'https://files.catbox.moe/f2t5wx.png',
- 'https://files.catbox.moe/wn3lnb.png',
- 'https://files.catbox.moe/0hovzu.png',
- 'https://files.catbox.moe/o51j3x.png',
- 'https://files.catbox.moe/f3m0hn.png',
- 'https://files.catbox.moe/l5g9hz.png',
- 'https://files.catbox.moe/gtzrly.png',
- 'https://files.catbox.moe/2uhqmh.png',
- 'https://files.catbox.moe/c1thg9.png',
- 'https://files.catbox.moe/vpb8zb.png',
- 'https://files.catbox.moe/ap62c3.png',
- 'https://files.catbox.moe/oew6wr.png',
- 'https://files.catbox.moe/ko07dx.png',
- 'https://files.catbox.moe/p2utwj.png',
- 'https://files.catbox.moe/vdyn8f.png',
- 'https://files.catbox.moe/pg27k4.png',
- 'https://files.catbox.moe/kl3zl6.png',
- 'https://files.catbox.moe/dlgoxk.png',
- 'https://files.catbox.moe/b6o7jw.gif',
- 'https://files.catbox.moe/nphjxw.png',
- 'https://files.catbox.moe/tnhi9y.png',
- 'https://files.catbox.moe/a2z5d1.png',
- 'https://files.catbox.moe/h5n1u4.png',
- 'https://files.catbox.moe/nb4zc8.png',
- 'https://files.catbox.moe/gdbcsa.png',
- 'https://files.catbox.moe/zbi7uc.png',
- 'https://files.catbox.moe/gs766f.png'
- ];
- // Helper function to get a random item from an array
- function getRandomItem(arr) {
- return arr[Math.floor(Math.random() * arr.length)];
- }
- // Function to simulate a file drop on the file input
- async function simulateFileUpload() {
- const randomImageUrl = getRandomItem(imageUrls);
- const imageName = randomImageUrl.split('/').pop(); // Extract the file name from the URL
- // Fetch the image data
- try {
- const response = await fetch(randomImageUrl);
- if (!response.ok) {
- console.error('Failed to fetch image:', randomImageUrl);
- return;
- }
- const blob = await response.blob();
- 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);
- // Find the file input and set the file
- const fileInput = document.querySelector('input[name="upfile"]');
- if (fileInput) {
- fileInput.files = dataTransfer.files;
- } else {
- console.error('File input not found.');
- }
- } catch (error) {
- console.error('Error fetching image:', error);
- }
- }
- // Function to populate the text field
- function populateTextField() {
- // Find the textarea and set random text
- const textArea = document.querySelector('textarea[name="com"]');
- if (textArea) {
- textArea.value = "Wow! Very nice art!";
- } else {
- console.error('Textarea not found.');
- }
- }
- // Function to submit the form
- function submitForm() {
- const submitButton = document.querySelector('input[type="submit"]');
- if (submitButton) {
- submitButton.click();
- } else {
- console.error('Submit button not found.');
- }
- }
- // Main function to run the sequence
- function postThread() {
- // 1. Click the "Start a New Thread" button
- const newThreadButton = document.querySelector('#togglePostFormLink a');
- if (newThreadButton) {
- newThreadButton.click();
- } else {
- console.error('New Thread button not found.');
- return; // Stop the process if the button isn't found
- }
- // 2. Simulate the file upload
- setTimeout(simulateFileUpload, 7000); // Wait 1 second before uploading the file
- // 3. Populate the text field
- setTimeout(populateTextField, 2000); // Wait 2 seconds before populating the text
- // 4. Submit the form after everything is set
- setTimeout(submitForm, 3000); // Submit 3 seconds after the initial button click
- }
- // Run the process
- postThread();
- })();
Add Comment
Please, Sign In to add comment