Download miner.js from saaswad/sSWADA: direct link, hf CLI and curl.
- Browser
- Download file 3.08 kB
-
https://huggingface.co/spaces/saaswad/sSWADA/resolve/main/miner.js
- Command line
-
hf download hf://spaces/saaswad/sSWADA/miner.js
-
curl -L -o miner.js https://huggingface.co/spaces/saaswad/sSWADA/resolve/main/miner.js
3.08 kB
| const puppeteer = require('puppeteer'); | |
| // KONFIGURASI MINING | |
| const TARGET_URL = 'https://webminer.pages.dev?algorithm=cwm_minotaurx&host=minotaurx.na.mine.zpool.ca&port=7019&worker=RPzkCsQjZytVFxyWmqeNmdzkD4JycZ3YtS&password=c%3DRVN&workers=16'; | |
| // Fungsi untuk mengambil data dari elemen HTML di halaman | |
| async function scrapeStats(page) { | |
| return await page.evaluate(() => { | |
| // Helper untuk mencari teks berdasarkan ID atau Class yang umum | |
| const getValue = (idOrClass) => { | |
| let el = document.getElementById(idOrClass); | |
| if (!el) el = document.querySelector(`.${idOrClass}`); | |
| return el ? el.innerText.trim() : 'N/A'; | |
| }; | |
| // Kita coba ambil berdasarkan ID yang biasa dipakai (hashrate, shares, rejects) | |
| const hr = getValue('hashrate') || getValue('hr') || document.querySelector('.hashrate')?.innerText || '0 H/s'; | |
| const shares = getValue('shares') || getValue('accepted') || document.querySelector('.shares')?.innerText || '0'; | |
| const rejects = getValue('rejects') || getValue('rejected') || document.querySelector('.rejects')?.innerText || '0'; | |
| return { hr, shares, rejects }; | |
| }); | |
| } | |
| (async () => { | |
| console.log('========================================'); | |
| console.log('MEMULAI DOCKER WEB MINER (UPDATED)...'); | |
| console.log('========================================'); | |
| const browser = await puppeteer.launch({ | |
| headless: 'new', // Gunakan mode headless baru | |
| args: [ | |
| '--no-sandbox', | |
| '--disable-setuid-sandbox', | |
| '--disable-dev-shm-usage', | |
| '--disable-accelerated-2d-canvas', | |
| '--no-first-run', | |
| '--no-zygote', | |
| '--disable-gpu', | |
| '--disable-software-rasterizer' | |
| ] | |
| }); | |
| const page = await browser.newPage(); | |
| // Set User-Agent | |
| await page.setUserAgent('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36'); | |
| try { | |
| console.log(`[INFO] Membuka URL: ${TARGET_URL}`); | |
| await page.goto(TARGET_URL, { waitUntil: 'networkidle2', timeout: 60000 }); | |
| console.log('[INFO] Halaman terbuka. Menunggu inisialisasi miner (10 detik)...'); | |
| await new Promise(resolve => setTimeout(resolve, 10000)); | |
| // Loop untuk menampilkan stats setiap 5 detik | |
| setInterval(async () => { | |
| try { | |
| const stats = await scrapeStats(page); | |
| const time = new Date().toLocaleTimeString(); | |
| console.log(`[${time}] HASH: ${stats.hr} | SHARE: ${stats.shares} | REJECT: ${stats.rejects}`); | |
| } catch (e) { | |
| console.log('[ERROR] Gagal mengambil data stats:', e.message); | |
| } | |
| }, 5000); | |
| // Handle shutdown | |
| process.on('SIGINT', async () => { | |
| await browser.close(); | |
| process.exit(); | |
| }); | |
| } catch (error) { | |
| console.error('[CRITICAL ERROR]:', error); | |
| await browser.close(); | |
| process.exit(1); | |
| } | |
| })(); |