Skip to content

Instantly share code, notes, and snippets.

@Rahul-Sagore
Last active December 31, 2017 01:18
Show Gist options
  • Save Rahul-Sagore/246e715eac6fc158969712264b40a6e9 to your computer and use it in GitHub Desktop.
Save Rahul-Sagore/246e715eac6fc158969712264b40a6e9 to your computer and use it in GitHub Desktop.
Change the Koinex.in title Bar to display Current Value of Cryptocurrencies.
//HOW to Use: Just paste the below function definition on developer console while you are on Koinex.in
// Then call this function on console with Crypto Name like for Bitcoin: showInTitle('BCH')
var showInTitle = (function showInTitle() {
console.log('Now you can call this function like: showInTitle("BTC");');
var CryptoArray = ['BTC', 'ETH', 'XRP', 'LTC', 'BCH', 'GNT', 'MIOTA', 'OMG'];
console.log('Available Cryptos are: ', CryptoArray.join(', '))
return function (cryptoName) {
var cryptoIndex = CryptoArray.indexOf(cryptoName);
cryptoIndex = cryptoIndex >= 0 ? cryptoIndex : 4;
if (window.titleInterval) clearInterval(window.titleInterval);
window.titleInterval = setInterval(function(){
var bch = $('.ticker-container .coin')[cryptoIndex];
$('title').text($('.ng-binding', bch).text().split(' ')[1]);
}, 2000)
}
})();
// Example
showInTitle('BCH')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment