Pular para o conteúdo

GPT – Send

Image

document.addEventListener(‘DOMContentLoaded’, function() {
const imageContainer = document.getElementById(‘image-container’);
const image = document.getElementById(‘image’);

// Fetch the image URLs from the Google Drive folder
fetch(‘https://www.googleapis.com/drive/v3/files?q=%271qs6MEgOrjddFAksz21SE7hUM4Bk4iFxo%27%20in%20parents’)
.then(response => response.json())
.then(data => {
const images = data.files.map(file => file.webContentLink);

// Randomly select an image URL
const randomIndex = Math.floor(Math.random() * images.length);
const randomImageURL = images[randomIndex];

// Display the image
image.src = randomImageURL;
});
});