Browse Source

enhance build process; add icon images

images
Michael Wuergler 7 years ago
parent
commit
b620c6dbd2
  1. 35
      build.js
  2. 4
      cryptocurrencies.json
  3. BIN
      images/007.png
  4. BIN
      images/1337.png
  5. BIN
      images/1CR.png
  6. BIN
      images/1ST.png
  7. BIN
      images/2015.png
  8. BIN
      images/2BACCO.png
  9. BIN
      images/2GIVE.png
  10. BIN
      images/32BIT.png
  11. BIN
      images/365.png
  12. BIN
      images/3DES.png
  13. BIN
      images/404.png
  14. BIN
      images/42.png
  15. BIN
      images/4CHN.png
  16. BIN
      images/611.png
  17. BIN
      images/808.png
  18. BIN
      images/888.png
  19. BIN
      images/8BIT.png
  20. BIN
      images/8BT.png
  21. BIN
      images/8S.png
  22. BIN
      images/ABC.png
  23. BIN
      images/ABT.png
  24. BIN
      images/ABY.png
  25. BIN
      images/ABYSS.png
  26. BIN
      images/AC.png
  27. BIN
      images/AC3.png
  28. BIN
      images/ACC.jpg
  29. BIN
      images/ACCO.png
  30. BIN
      images/ACE.png
  31. BIN
      images/ACES.png
  32. BIN
      images/ACID.png
  33. BIN
      images/ACN.png
  34. BIN
      images/ACOIN.png
  35. BIN
      images/ACP.png
  36. BIN
      images/ACT*.png
  37. BIN
      images/ACT.png
  38. BIN
      images/ADA.png
  39. BIN
      images/ADB.png
  40. BIN
      images/ADC.png
  41. BIN
      images/ADCN.png
  42. BIN
      images/ADL.png
  43. BIN
      images/ADN.png
  44. BIN
      images/ADST.png
  45. BIN
      images/ADT.png
  46. BIN
      images/ADX.png
  47. BIN
      images/ADZ.jpg
  48. BIN
      images/AE.png
  49. BIN
      images/AEC.png
  50. BIN
      images/AEON.png
  51. BIN
      images/AERM.png
  52. BIN
      images/AERO.png
  53. BIN
      images/AGRS.png
  54. BIN
      images/AGS.png
  55. BIN
      images/AHT*.png
  56. BIN
      images/AHT.png
  57. BIN
      images/AIB.png
  58. BIN
      images/AID.png
  59. BIN
      images/AION.png
  60. BIN
      images/AIR*.png
  61. BIN
      images/AIR.png
  62. BIN
      images/ALC.png
  63. BIN
      images/ALEX.png
  64. BIN
      images/ALF.png
  65. BIN
      images/ALIS.png
  66. BIN
      images/ALN.png
  67. BIN
      images/ALQO.png
  68. BIN
      images/ALTCOM.png
  69. BIN
      images/ALTOCAR.png
  70. BIN
      images/AM.png
  71. BIN
      images/AMB.png
  72. BIN
      images/AMBER.png
  73. BIN
      images/AMC.png
  74. BIN
      images/AMIS.png
  75. BIN
      images/AMM.png
  76. BIN
      images/AMMO.png
  77. BIN
      images/AMP.png
  78. BIN
      images/AMS.png
  79. BIN
      images/AMT.jpg
  80. BIN
      images/AMY.jpg
  81. BIN
      images/ANAL.jpg
  82. BIN
      images/ANC.png
  83. BIN
      images/ANCP.png
  84. BIN
      images/AND.png
  85. BIN
      images/ANT.png
  86. BIN
      images/ANTC.png
  87. BIN
      images/ANTI.png
  88. BIN
      images/APC.png
  89. BIN
      images/APEX.png
  90. BIN
      images/APPC.png
  91. BIN
      images/APT.png
  92. BIN
      images/APX.png
  93. BIN
      images/AR*.png
  94. BIN
      images/ARB.png
  95. BIN
      images/ARBI.png
  96. BIN
      images/ARC*.png
  97. BIN
      images/ARC.png
  98. BIN
      images/ARCH.png
  99. BIN
      images/ARCO.png
  100. BIN
      images/ARDR.png

35
build.js

@ -1,8 +1,13 @@
const fs = require('fs');
const fetch = require('isomorphic-fetch');
const sortby = require('lodash.sortby');
const request = require('sync-request');
const endpoint = 'https://www.cryptocompare.com/api/data/coinlist/';
const ora = require('ora');
const chalk = require('chalk');
const spinner = ora('Building currencies').start();
spinner.color = 'magenta';
fetch(endpoint)
.then(response => response.json())
@ -10,17 +15,34 @@ fetch(endpoint)
const sorted = sortby(json.Data, o => o.CoinName);
const symbols = {};
let imagesSaved = 0;
/**
* Build the JSON file based on the cryptocompare coinlist.
*/
sorted.forEach(currency => {
const {Name, CoinName} = currency;
sorted.forEach((currency, index) => {
const { Name, CoinName, ImageUrl } = currency;
symbols[Name] = CoinName;
// download the image for future use
if (ImageUrl) {
spinner.text = `${chalk.gray(index)} ${Name}`;
spinner.render();
const res = request('get', `https://www.cryptocompare.com${ImageUrl}`);
fs.writeFileSync(`images/${Name}.${ImageUrl.split('.').pop()}`, res.getBody());
imagesSaved = imagesSaved + 1;
}
});
spinner.succeed([`${imagesSaved} images saved to /images`]);
spinner.color = 'yellow';
spinner.start(`Saving cryptocurrencies.json file`);
fs.writeFileSync('cryptocurrencies.json', JSON.stringify(symbols, null, 2));
console.log('JSON File written');
spinner.succeed(`${sorted.length} currencies saved to cryptocurrencies.json`);
spinner.start('Saving Readme');
/**
* Build the Markdown Table of currencies in the Readme.
@ -45,6 +67,9 @@ fetch(endpoint)
const targetRegex = /<!-- BEGIN TABLE INJECT -->(\w|\W)*<!-- END TABLE INJECT -->/gim;
const updated = template.replace(targetRegex, `<!-- BEGIN TABLE INJECT -->\n${table}\n<!-- END TABLE INJECT -->`);
fs.writeFileSync('readme.md', updated);
console.log('Readme Markdown Table updated');
spinner.succeed(['Readme Markdown Table updated']);
console.log('\n', 'Remember to', chalk.yellow('git commit'), 'and', chalk.yellow('npm publish'));
})
.catch(err => console.error(err));

4
cryptocurrencies.json

@ -304,8 +304,8 @@
"BURST": "BurstCoin",
"BUZZ": "BuzzCoin",
"BYC": "ByteCent",
"BTE": "ByteCoin",
"BCN": "ByteCoin",
"BTE": "ByteCoin",
"GBYTE": "Byteball",
"BTH": "Bytether ",
"BTM*": "Bytom",
@ -1884,7 +1884,7 @@
"WISC": "WisdomCoin",
"WSC": "WiserCoin",
"WSH": "Wish Finance",
"WISH*": "WishFinance",
"WISH* (1)": "WishFinance",
"WLK": "Wolk",
"WOMEN": "WomenCoin",
"LOG": "Wood Coin",

BIN
images/007.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
images/1337.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

BIN
images/1CR.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

BIN
images/1ST.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
images/2015.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
images/2BACCO.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
images/2GIVE.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
images/32BIT.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

BIN
images/365.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
images/3DES.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
images/404.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
images/42.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
images/4CHN.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

BIN
images/611.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

BIN
images/808.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
images/888.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
images/8BIT.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
images/8BT.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

BIN
images/8S.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
images/ABC.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
images/ABT.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
images/ABY.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

BIN
images/ABYSS.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

BIN
images/AC.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
images/AC3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
images/ACC.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
images/ACCO.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

BIN
images/ACE.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

BIN
images/ACES.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
images/ACID.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
images/ACN.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

BIN
images/ACOIN.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
images/ACP.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

BIN
images/ACT*.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
images/ACT.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
images/ADA.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
images/ADB.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
images/ADC.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

BIN
images/ADCN.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 KiB

BIN
images/ADL.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
images/ADN.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

BIN
images/ADST.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
images/ADT.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
images/ADX.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
images/ADZ.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
images/AE.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

BIN
images/AEC.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

BIN
images/AEON.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
images/AERM.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
images/AERO.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
images/AGRS.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
images/AGS.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

BIN
images/AHT*.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
images/AHT.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
images/AIB.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

BIN
images/AID.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
images/AION.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

BIN
images/AIR*.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
images/AIR.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

BIN
images/ALC.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

BIN
images/ALEX.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
images/ALF.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

BIN
images/ALIS.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
images/ALN.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

BIN
images/ALQO.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
images/ALTCOM.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
images/ALTOCAR.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
images/AM.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
images/AMB.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
images/AMBER.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

BIN
images/AMC.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

BIN
images/AMIS.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

BIN
images/AMM.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
images/AMMO.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

BIN
images/AMP.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
images/AMS.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
images/AMT.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
images/AMY.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
images/ANAL.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

BIN
images/ANC.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
images/ANCP.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
images/AND.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

BIN
images/ANT.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

BIN
images/ANTC.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 KiB

BIN
images/ANTI.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
images/APC.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
images/APEX.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

BIN
images/APPC.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

BIN
images/APT.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

BIN
images/APX.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
images/AR*.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
images/ARB.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
images/ARBI.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
images/ARC*.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
images/ARC.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
images/ARCH.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
images/ARCO.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 KiB

BIN
images/ARDR.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save