Skip to content

Instantly share code, notes, and snippets.

@kord123
Created November 13, 2018 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kord123/e1c7c7c1a6acf4085b70df6e17ff5911 to your computer and use it in GitHub Desktop.
Save kord123/e1c7c7c1a6acf4085b70df6e17ff5911 to your computer and use it in GitHub Desktop.
Run Chromium under puppeteer to mine Hadron coins
import * as puppeteer from 'puppeteer';
import {Page} from "puppeteer";
const email = "<your email>";
const password = "<your password>";
(async () => {
const browser = await puppeteer.launch({headless: false});
const page: Page = await browser.newPage();
await page.setViewport({width:1920, height: 1080});
await page.goto("https://hadron.cloud/dashboard");
await page.waitForXPath("//input[@name='email']").then(field => field.type(email));
await page.waitForXPath("//input[@name='password']").then(field => field.type(password));
await page.waitForXPath("//input[@type='submit']").then(button => button.click());
await page.waitForXPath(`//div[@class='text' and text()='${email}']`).then(field => field.type(password));
await page.goto("https://hadron.cloud/dashboard/mining_alpha");
await page.waitForXPath("//div[@class='button toggle-mining' and text()='Start Mining']")
.then(button => button.click());
console.log("8");
setInterval(async () => {
const element = await page.waitForXPath("//div[@class='balance']/div[@class='value']");
const text = await page.evaluate(div => div.textContent, element);
console.log(`${new Date().toLocaleString()}. Balance: ${text}`);
}, 60000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment