Zenohack.com Sniper Official
app.use('/api', require('./routes/api')); app.get('/', (req, res) => res.render('index'));
module.exports = mongoose.model('Profile', ProfileSchema); const TaskSchema = new mongoose.Schema({ name: String, productUrl: String, profileId: { type: mongoose.Schema.Types.ObjectId, ref: 'Profile' }, maxPrice: Number, size: String, quantity: { type: Number, default: 1 }, status: { type: String, enum: ['idle', 'running', 'completed', 'failed'], default: 'idle' }, runs: { type: Number, default: 0 }, lastRun: Date, createdAt: { type: Date, default: Date.now } }); module.exports = mongoose.model('Task', TaskSchema); models/Log.js const LogSchema = new mongoose.Schema({ taskId: { type: mongoose.Schema.Types.ObjectId, ref: 'Task' }, message: String, type: { type: String, enum: ['info', 'success', 'error'] }, timestamp: { type: Date, default: Date.now } }); 4. Core Sniper Service services/sniper.js const puppeteer = require('puppeteer-extra'); const StealthPlugin = require('puppeteer-extra-plugin-stealth'); puppeteer.use(StealthPlugin()); const notifier = require('./notifier'); const Log = require('../models/Log'); const Profile = require('../models/Profile'); async function snipeTask(task) { const profile = await Profile.findById(task.profileId); if (!profile) throw new Error('Profile missing'); Zenohack.com Sniper
// 5. Go to checkout await page.goto(process.env.ZENOHACK_CHECKOUT_URL, { waitUntil: 'networkidle2' }); module.exports = mongoose.model('Profile'
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(); } } profileId: { type: mongoose.Schema.Types.ObjectId
log( Starting snipe for ${task.productUrl} , 'info');
// Get profiles router.get('/profiles', async (req, res) => { const profiles = await Profile.find(); res.json(profiles); });
const log = (msg, type = 'info') => { Log.create({ taskId: task._id, message: msg, type }); console.log( [${task.name}] ${msg} ); };