Modify this so that it also visits https://motherless.com/GB48E67A and monitors the…
- User
Modify this so that it also visits https://motherless.com/GB48E67A and monitors the
#media-info > div.row > div > div.gallery-meta > div.gallery-meta-stats > span:nth-child(3)the field there the same exact way, except it should print "new DR upload: " proceeded by number.codeconst express = require('express'); const { Client } = require('discord.js-selfbot-v13'); const axios = require('axios'); const cheerio = require('cheerio'); const app = express(); const PORT = process.env.PORT || 5000; const profileUrl = 'https://motherless.com/m/cruizinnn'; const specialUserId = '561629185471414314'; let lastUploadCount = null; app.get('/', (req, res) => { console.log('Received a GET request on /'); res.send('Hello World'); }); const client = new Client({ disableEveryone: true }); const scrapeUploads = async () => { try { const { data } = await axios.get(profileUrl); const $ = cheerio.load(data); const uploadText = $('#profile > div.profile-header-wrapper > div.profile-header-right > div > div.stats-wrapper > div:nth-child(5)').text(); const uploadCount = parseInt(uploadText.replace(/\D/g, ''), 10); return uploadCount; } catch (error) { console.error('Error scraping upload count:', error); return null; } }; const checkUploads = async () => { const newUploadCount = await scrapeUploads(); if (newUploadCount !== null && newUploadCount !== lastUploadCount) { console.log(`Uploads count changed: ${newUploadCount}`); lastUploadCount = newUploadCount; try { const user = await client.users.fetch(specialUserId); if (user) { await user.send(`Uploads count is now: ${newUploadCount}`); console.log(`Sent update to user ${specialUserId}`); } } catch (error) { console.error('Error sending Discord message:', error); } } }; app.listen(PORT, '0.0.0.0', () => { console.log(`Example app listening at http://0.0.0.0:${PORT}`); }); client.on('ready', () => { console.log(`Logged in as ${client.user.tag}!`); client.user.setPresence({ status: 'invisible', afk: true, }); console.log('Setting user as AFK'); client.user.setAFK(true); // Start checking uploads every second setInterval(checkUploads, 60000); }); setTimeout(() => { console.log('Logging in'); client.login(process.env.TOKEN).then(() => { setInterval(() => { //console.log('Setting user as AFK'); client.user.setAFK(true); }, 10000); }); }, 1); - Assistant