Created
October 3, 2017 08:29
-
-
Save Inigovd/5b47e63e360e97d99e3f68c8fe1b2d58 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Etherparty ICO $ calculator | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author Mattblack | |
// @match https://etherparty.io/ico/ | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var formatter = new Intl.NumberFormat('en-US', { | |
style: 'currency', | |
currency: 'USD', | |
minimumFractionDigits: 2 | |
}); | |
jQuery(document).ready(function(){ | |
setTimeout(function(){ | |
jQuery.get('https://api.gdax.com/products/ETH-USD/ticker', function(response){ | |
var sold_eth = parseInt(jQuery('#jsEthRaised').text().replace(',', '')); | |
var sold_usd = sold_eth * response.price; | |
var elem = jQuery('<div/>').addClass('h5').html(formatter.format(sold_usd)); | |
jQuery(elem).insertAfter(jQuery('.hero-content a')); | |
}, 'json'); | |
}, 2500); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment