janboddez / import-from-mastodon

Automatically turn toots—short messages on Mastodon—into WordPress posts.
GNU General Public License v3.0
13 stars 2 forks source link

Save since_id (and reset it when needed) #11

Closed janboddez closed 2 years ago

janboddez commented 2 years ago

Can we store the since_id instead of looking it up each time? Now, if the most recent post is deleted, the since_id will be that of the next post, and the more recent toot will be imported again.

Alternatively, but this seems overkill, keep a list of previously imported toot IDs. (This is how we would do it for APIs that don't support a since_id.)

janboddez commented 2 years ago

since_id becomes "moot" when moving instances, so saving it and dropping it if the instance URL is ever changed might just work.

janboddez commented 2 years ago

We now do this: https://github.com/janboddez/import-from-mastodon/commit/d4fe0e00a5772a2e5868a0cad9cdab3b9e830cd9#diff-856e2d34dc8d0eab631549b1bba03f9d2e3944bf5f17a1604700c50d02b466ebR71

Always save the latest toot ID immediately after import (not sure how bad this is for performance, but it is what it is), then reset it when switching instances.