1

I couldn't find any answer for my issue.

I already run html file with javascript, which showed me on my website actual rate.

<div id="price1"></div>

const API_URL = 'https://api.coinmarketcap.com/v1/ticker/?limit=1';
function displayData() {
 fetch(API_URL)
   .then(res => res.json())
    .then(json => {
     const topCoin = json[0];
     document.getElementById('price1').innerHTML = `${topCoin.price_usd}` + "BTC";
    });
}
setInterval(displayData, 500);

But what I want is have this rate writed to .txt file. Is it possible do it with javascript or do I have to use another language? If I have to use another way can you help me out?

Moe
  • 13
  • 3
  • 1
    Possible duplicate of [Is it possible to write data to file using only JavaScript?](https://stackoverflow.com/questions/21012580/is-it-possible-to-write-data-to-file-using-only-javascript) – Milan Velebit Nov 20 '18 at 21:22
  • It is not possible access local sources directly, couse of security restrictions of browsers... – kanpinar Nov 20 '18 at 21:27
  • I thought so but my question was also for help me out with another language because I am not profi programmer guy... – Moe Nov 20 '18 at 21:33
  • you should show your attempt at using another language to write the file. Otherwise any help someone would give would be a complete guess at what you need. I would start googling how to write to a file using x language. – Andrew Lohr Nov 21 '18 at 01:13
  • I actually know how to write something to txt file in another language, but I don't know how to get rate from any internet website and then use it in different language, like I did in this case with javascript... – Moe Nov 21 '18 at 10:05

0 Answers0