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

$ 89660.01 (-0.09%)
Объем 24H $34.149b
Изменеия 24h: -0.44 %, 7d: -6.13 %
Cегодня L: $89202.52 - H: $89764.03
Капитализация $1791.366b Rank 1
Цена в час новости $ 6401.89 (1300.52%)

price bitcoin genserver def start data let

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


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


Фото:

Bitcoin Big Move Incoming? BTC Whales Are Stacking Long Positions At A Rapid Pace

Bitcoin’s price may be showcasing slight upward movement, but the overall outlook is still quite bearish considering the volatile state of the broader cryptocurrency market. Even with the flagship asset trading below the $90,000 price mark for the past few weeks, expectations for another huge rally remain solid in the hearts of major investors as […]

2025-12-29 19:00


Bitcoin Critical Holders’ Profit Crashes To Monthly Low: Will Price Further Suffer?

Bitcoin has shown mixed price action in recent sessions, marked by sharp fluctuations and tentative recovery attempts. BTC rebounded after a brief breakdown, yet momentum remains fragile.   A key concern is weakening confidence among one of Bitcoin’s most influential cohorts, which could complicate efforts to sustain a broader price recovery.

2025-12-22 01:27


Bitcoin - Standard Chartered's revised projection and why THIS is 'no longer a price driver'

Standard Chartered, the multinational banking giant, is in the news today after it significantly revised its price forecast for Bitcoin. In fact, it dramatically cut its 2025 projection in half. ThisThe post Bitcoin - Standard Chartered's revised projection and why THIS is 'no longer a price driver' appeared first on AMBCrypto.

2025-12-11 08:00


Bitcoin ‘True Bull Run’ May Yet To Begin — Analyst Explains Why

The Bitcoin price action has been somewhat impressive in 2025, as the flagship cryptocurrency ascended from around $93,300 in early January to its current all-time-high price of $126,000 this month. While the digital asset saw a couple of resets along the way, it continued to put in new highs, reflecting the magnitude of confidence held by its long-term investors.

2025-10-26 19:30