Skip to content

Instantly share code, notes, and snippets.

@Inigovd
Created October 3, 2017 08:29
Show Gist options
  • Select an option

  • Save Inigovd/5b47e63e360e97d99e3f68c8fe1b2d58 to your computer and use it in GitHub Desktop.

Select an option

Save Inigovd/5b47e63e360e97d99e3f68c8fe1b2d58 to your computer and use it in GitHub Desktop.

Revisions

  1. Inigovd created this gist Oct 3, 2017.
    30 changes: 30 additions & 0 deletions etherparty_ico_usd.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    // ==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);
    });
    })();