Using Elixir to Track The Price of Bitcoin

Using Elixir to Track The Price of Bitcoin
фото показано с : bitcoints.com

2018-7-10 19:38

Since our project will be fetching the price of a Bitcoin, we need a place to fetch Bitcoin data.
Finally let’s get the price with Map.get, now that we have the price let’s print what the price was.
lib/teacher/coin_data_worker.ex

defmodule Teacher.CoinDataWorker do
use GenServer

def start_link(args) do
GenServer.start_link(__MODULE__, args, name: __MODULE__)
end

def init(state) do
schedule_coin_fetch()
{:ok, state}
end

def handle_info(:coin_fetch, state) do
price = coin_price()
IO.inspect(“Current Bitcoin price is $#{price}”)
schedule_coin_fetch()
{:noreply, Map.put(state, :btc, price)}
end

defp coin_price do
“http://coincap.io/page/BTC”
|> HTTPoison.get!
$ iex -S mix
“Current Bitcoin price is $6149.728”
“Current Bitcoin price is $6149.728”
“Current Bitcoin price is $6149.728”
“Current Bitcoin price is $6149.728”
> :observer.start()
This is great – we’re fetching data from the API, parsing it, and logging the price.
$ iex -S mix
> “Current Litecoin price is $81.0156”
“Current Ethereum price is $454.076”
“Current Bitcoin price is $6148.09”
> :observer.start()
And let’s start the observer.

origin »

Bitcoin price in Telegram @btc_price_every_hour

Bitcoin (BTC) на Currencies.ru

$ 75778.17 (-0.27%)
Объем 24H $26.536b
Изменеия 24h: -0.45 %, 7d: 6.91 %
Cегодня L: $75006.76 - H: $76173.47
Капитализация $1516.935b Rank 1
Цена в час новости $ 6401.89 (1083.68%)

price bitcoin genserver def start data let

price bitcoin → Результатов: 126


Фото:

Bonk Price Prediction 2026: Pepeto Presale Fills as Bitcoin ETFs Cross $100 Billion in Assets

Bitcoin spot ETFs just crossed $100 billion in cumulative assets under management, and that milestone proves institutional capital is no longer testing the water but diving in headfirst.  While every bonk price prediction adjusts around this wave of new money, the meme coins sitting 90% below their peaks need months of sustained buying to deliver […] The post Bonk Price Prediction 2026: Pepeto Presale Fills as Bitcoin ETFs Cross $100 Billion in Assets appeared first on CaptainAltcoin.

2026-4-10 09:35


Фото:

Bitcoin Price Continues Sliding as President Trump Signals Iran Escalation, Raising Risk of Drop Toward $60,000

Bitcoin Magazine Bitcoin Price Continues Sliding as President Trump Signals Iran Escalation, Raising Risk of Drop Toward $60,000 Bitcoin price fell nearly 4% after President Trump signaled potential escalation against Iran, sparking a broad risk-off move across global markets and dragging the BTC price temporarily below $66,000.

2026-4-3 17:47


Фото:

Elliot Wave Theory Says Bitcoin Price Is Headed To $40,000, But The End Game Will Shock You

A technical analyst known as ‘V’ has shared a striking Elliott Wave Theory-based Bitcoin price outlook on X that he believes most market participants are completely overlooking. The chart, plotted on Bitcoin’s weekly timeframe, outlines a multi-year roadmap that could first subject the cryptocurrency to significant downside pressure, potentially triggering a price crash to $40,000 before setting the stage for an explosive rally that could shock investors and traders.

2026-3-4 18:00


Kaspa (KAS) Price Mirrors Bitcoin’s Early Path As Chart Points To New All Time High

Kaspa price is back in focus after a chart surfaced showing a striking resemblance between KAS price action and Bitcoin price behavior before one of its most powerful historical rallies. The visual comparison is hard to ignore, showing a long consolidation phase, gradual upward pressure, and then a sharp expansion that changed Bitcoin’s trajectory completely.

2026-1-21 17:30


Фото:

Bitcoin demand is breaking out, but dealers are mechanically forcing stability: Here is the exact price the dam cracks

Bitcoin is now trading around near $96,000 as spot ETF inflows and options market positioning exert opposing mechanical forces on price behavior. The current price sits just outside a range between roughly $90,000 and $94,000, a band that has persisted despite intermittent surges and declines in spot demand through US-listed Bitcoin exchange-traded funds.

2026-1-16 20:50