mattn / bsky

A cli application for bluesky social
269 stars 26 forks source link

Add cursor argument to stream for backfill #10

Closed lxcode closed 1 year ago

lxcode commented 1 year ago

In case of stream interruption, there's a cursor argument to get events you missed. Just plug in the last seq you received.

Also update dependencies, as the old version of indigo didn't know what a block event was.

mattn commented 1 year ago

Thank your contribution. Looks good, but how do you know the previous cursor?

lxcode commented 1 year ago

Each record has a seq value — use the last sequence number you have in your locally stored data. In my case, I'm using json output, so I do:

cat foo.jsonl | jq '.seq' | tail -1

mattn commented 1 year ago

Thanks. Good to hear how to do it.