Skip to content

Instantly share code, notes, and snippets.

@anilkay
Created May 17, 2020 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anilkay/6c063d6d3b4c99ffaf33dc48fc50943a to your computer and use it in GitHub Desktop.
Save anilkay/6c063d6d3b4c99ffaf33dc48fc50943a to your computer and use it in GitHub Desktop.
from win10toast import ToastNotifier
import requests
from datetime import datetime
ticker_url="https://api.btcturk.com/api/v2/ticker"
toaster=ToastNotifier()
now=datetime.now()
formatted_time = now.strftime("%H:%M")
toast_title="Coin Fiyatları "+formatted_time
toast_body=""
response=requests.get(ticker_url)
if response.status_code==200:
data=response.json()["data"]
for currency in data:
name=currency["pair"]
last=currency["last"]
toast_body+=name+" "+str(last)+"\n"
toaster.show_toast(toast_title,
toast_body,
duration=10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment