Skip to content

Fix: On run choose the next post, not latest#1

Open
JojoYou wants to merge 1 commit into
mirsadra:mainfrom
JojoYou:fix/next-post
Open

Fix: On run choose the next post, not latest#1
JojoYou wants to merge 1 commit into
mirsadra:mainfrom
JojoYou:fix/next-post

Conversation

@JojoYou

@JojoYou JojoYou commented Oct 3, 2025

Copy link
Copy Markdown

Amazing tool!

Problem: I use it for a week and noticed that when I post 2 or more posts to Mastodon in between script runs it chooses to repost only the latest Mastodon post to X. I want it to post all of them. I am completely fine to post only 1 X post per script run.

Apologies for the many changes, that's my editor formatting the code.

Important part is this:

# Find the next entry to post
    next_entry = None
    if last_post_id is None:
        # First run - post the latest
        next_entry = feed.entries[0]
    else:
        # Find the entry that comes right after last_post_id
        for i, entry in enumerate(feed.entries):
            if entry.id == last_post_id:
                # Found the last posted entry, get the one before it (newer)
                if i > 0:
                    next_entry = feed.entries[i - 1]
                break

Fix: It picks only the next post right after already synced post. Not the latest one. This way, it posts every Mastodon post 1 by 1 on every script run. 1 run = 1 synced post, but the next post, not the latest one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant