Skip to content

Instantly share code, notes, and snippets.

@TAG-Epic
Last active March 16, 2021 17:09
Show Gist options
  • Select an option

  • Save TAG-Epic/a09c7286a215165e96a7e39b5f835219 to your computer and use it in GitHub Desktop.

Select an option

Save TAG-Epic/a09c7286a215165e96a7e39b5f835219 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Monero f2pool stats
// @namespace tag-epic
// @version 1.0
// @description Gets your current monero stats
// @author Epic
// @match https://www.f2pool.com/xmr/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
document.onkeydown = async (e) => {
if (e.which !== 81) return;
let totalRaw = document.querySelector("body > div.page-wrapper.has-tips.lang-en_US > div.page-main > div > div.header.row.justify-content-center.layout-header-in > div > div.mining-user-info-container.row.justify-content-center > div.row.col-12.order-lg-1.row-revenue > div.col-6.col-lg.order-lg-1.item > div > div").innerText;
let todayRaw = document.querySelector("body > div.page-wrapper.has-tips.lang-en_US > div.page-main > div > div.header.row.justify-content-center.layout-header-in > div > div.mining-user-info-container.row.justify-content-center > div.row.col-12.order-lg-1.row-revenue > div.col-6.col-lg.order-lg-5.item > div > div").innerText;
let total = parseFloat(totalRaw);
let today = parseFloat(todayRaw);
// Get current rate
let res = await fetch("https://api.cryptonator.com/api/ticker/xmr-usd");
let data = await res.json();
let conversion = parseFloat(data.ticker.price);
let bal = total + today
let afterConversion = bal * conversion
alert(`Balance (USD): ${afterConversion}$\nBalance (XMR): ${bal}`);
}
})();
@TAG-Epic
Copy link
Copy Markdown
Author

Usage
Go to your f2pool dashboard
press "Q"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment