BlockchainCuties Currency Changer

a small script for Blockchain Cuties to change currency

  1. // ==UserScript==
  2. // @name BlockchainCuties Currency Changer
  3. // @version 0.62
  4. // @description a small script for Blockchain Cuties to change currency
  5. // @author VeRychard <me@verychard.com>
  6. // @icon http://hyperfocus.net/darkcuties_logo.png
  7. // @match https://blockchaincuties.co/pet/*
  8. // @match https://blockchaincuties.co/item/*
  9. // @match https://blockchaincuties.co/pets_sell*
  10. // @match https://blockchaincuties.co/pets_breed*
  11. // @match https://blockchaincuties.co/items_sell*
  12. // @match https://blockchaincuties.co/shop
  13. // @match https://blockchaincuties.com/pet/*
  14. // @match https://blockchaincuties.com/item/*
  15. // @match https://blockchaincuties.com/pets_sell*
  16. // @match https://blockchaincuties.com/pets_breed*
  17. // @match https://blockchaincuties.com/items_sell*
  18. // @match https://blockchaincuties.com/shop
  19. // @grant none
  20. // @namespace https://greasyfork.org/users/193828
  21. // ==/UserScript==
  22. // @require http://code.jquery.com/jquery-latest.js
  23.  
  24. (function() {
  25. 'use strict';
  26. var ethPriceEur = 0;
  27. var ethPriceUsd = 0;
  28. $.ajax({
  29. url: 'https://api.coinmarketcap.com/v2/ticker/1027/?convert=EUR',
  30. type: 'GET',
  31. success: function(res) {
  32. ethPriceEur = res.data.quotes.EUR.price;
  33. ethPriceUsd = res.data.quotes.USD.price;
  34. }});
  35. $(document).ready(function() {
  36. setTimeout(
  37. function()
  38. {
  39. var ethVal = 0;
  40. $('.price_icon:contains("Ξ")').each(function(){
  41. ethVal = parseFloat($(this).next('span').text());
  42. var priceEur = (Math.round((ethVal * ethPriceEur)*100) / 100) + ' EUR';
  43. var priceUsd = (Math.round((ethVal * ethPriceUsd)*100) / 100) + ' USD';
  44. $(this).parents('.pet_card_status').attr('title', priceEur + ' / ' + priceUsd);
  45. $(this).parents('.pet_bid-box').attr('title', priceEur + ' / ' + priceUsd);
  46. $(this).parents('.pet_banner-status').attr('title', priceEur + ' / ' + priceUsd);
  47. });
  48. $('span[data-click="shop_buy_eth"]').each(function(){
  49. ethVal = parseFloat($(this).text().substring(2));
  50. console.log(ethVal);
  51. var priceEur = (Math.round((ethVal * ethPriceEur)*100) / 100) + ' EUR';
  52. var priceUsd = (Math.round((ethVal * ethPriceUsd)*100) / 100) + ' USD';
  53. $(this).parents('.shop-buy-button-empty').attr('title', priceEur + ' / ' + priceUsd);
  54. });
  55. }, 2500);
  56. });
  57.  
  58. $("body").on('DOMSubtreeModified', ".cutie_gal", function() {
  59. setTimeout(
  60. function()
  61. {
  62. var ethVal = 0;
  63. $('.price_icon:contains("Ξ")').each(function(){
  64. ethVal = parseFloat($(this).next('span').text());
  65. var priceEur = (Math.round((ethVal * ethPriceEur)*100) / 100) + ' EUR';
  66. var priceUsd = (Math.round((ethVal * ethPriceUsd)*100) / 100) + ' USD';
  67. $(this).parents('.pet_card_status').attr('title', priceEur + ' / ' + priceUsd);
  68. });
  69. $('span[data-click="shop_buy_eth"]').each(function(){
  70. ethVal = parseFloat($(this).text().substring(2));
  71. console.log(ethVal);
  72. var priceEur = (Math.round((ethVal * ethPriceEur)*100) / 100) + ' EUR';
  73. var priceUsd = (Math.round((ethVal * ethPriceUsd)*100) / 100) + ' USD';
  74. $(this).parents('.shop-buy-button-empty').attr('title', priceEur + ' / ' + priceUsd);
  75. });
  76. }, 2500);
  77. });
  78. })();