const log = (msg, type = 'info') => { Log.create({ taskId: task._id, message: msg, type }); console.log( [${task.name}] ${msg} ); };
// 5. Go to checkout await page.goto(process.env.ZENOHACK_CHECKOUT_URL, { waitUntil: 'networkidle2' }); Zenohack.com Sniper
const success = await page.$('.order-confirmation'); if (success) { log('Order placed successfully!', 'success'); await notifier.sendDiscord(`✅ **SNIPER SUCCESS**\nTask: ${task.name}\nProduct: ${task.productUrl}\nProfile: ${profile.name}`); } else { throw new Error('Checkout failed – no confirmation'); } } catch (err) { log( Error: ${err.message} , 'error'); await notifier.sendDiscord( ❌ **SNIPER FAILED**\nTask: ${task.name}\nReason: ${err.message} ); } finally { await browser.close(); } } const log = (msg, type = 'info') => { Log
module.exports = { sendDiscord }; routes/api.js const express = require('express'); const router = express.Router(); const Task = require('../models/Task'); const Profile = require('../models/Profile'); const { snipeTask } = require('../services/sniper'); // Create sniper task router.post('/tasks', async (req, res) => { const task = await Task.create(req.body); res.json(task); }); const log = (msg
// 6. Fill billing info await page.type('#fullName', profile.billing.fullName); await page.type('#address', profile.billing.address); await page.type('#city', profile.billing.city); await page.type('#zip', profile.billing.zip); await page.type('#cardNumber', profile.billing.cardNumber); await page.type('#expiry', profile.billing.expiry); await page.type('#cvv', profile.billing.cvv);