You are viewing a single comment's thread from:

RE: Steemit API Question

in #steemdev5 years ago (edited)

I can get the latest block in python like this:
from steem import Steem
import pprint

stm = Steem()
num = stm.head_block_number
newest_block = stm.get_block(num)

pprint.pprint(newest_block)

Have you tried asking in SteemDev discord? You may be able to get a better answer there.

Sort:  

Gah I'm actually trying this and have the same damn problem.

client.blockchain.getCurrentBlockHeader()

Gives me a block that is a minute old.
Are you sure Python is giving brand new blocks?

Yes, just tested with this while loop and compared with head block numbers on steemd.com.
Seems to be returning the correct block numbers.

lb.png

I miss Python... it's been so long.

So apparently getOperationsStream() is just broken.
getBlockStream() is working for getting the new blocks.

Thanks for your time though and reminding me how awesome Python is.

I was thinking about "cheating" like this.

Best suggestion so far though so... 100% upvote and all that.

Coin Marketplace

STEEM 0.18
TRX 0.14
JST 0.030
BTC 59238.58
ETH 3176.28
USDT 1.00
SBD 2.45