mirror of
https://github.com/mroxso/timechain-nostr-bot.git
synced 2025-03-17 13:22:02 +01:00
change block height source to blockstream (#7)
This commit is contained in:
parent
f875282f49
commit
4841f1074f
7
main.py
7
main.py
@ -42,11 +42,8 @@ try:
|
||||
while True:
|
||||
failCount = 0
|
||||
try:
|
||||
url = "https://blockchain.info/latestblock"
|
||||
response = requests.get(url)
|
||||
data = response.json()
|
||||
block_height = data["height"]
|
||||
|
||||
url = "https://blockstream.info/api/blocks/tip/height"
|
||||
block_height = requests.get(url).json()
|
||||
if(block_height > old_block_height):
|
||||
message = "⚡️ " + str(block_height) + " ⚡️"
|
||||
print(message)
|
||||
|
Loading…
x
Reference in New Issue
Block a user