Skip to content

Duplicating same tweets when following more users with Twitter-bot #697

Open
@jiriryszawy

Description

@jiriryszawy

When following multiple users on Twitter with Twitter-bot using crontab, the same tweets will be will be importing again and again everytime crontab call the twitter-bot script. Using

*/5 * * * * /usr/local/share/zulip/integrations/twitter/twitter-bot --twitter-name="@TwitterUsername1" --config-file=~/zuliprc
*/5 * * * * /usr/local/share/zulip/integrations/twitter/twitter-bot --twitter-name="@TwitterUsername2" --config-file=~/zuliprc
*/5 * * * * /usr/local/share/zulip/integrations/twitter/twitter-bot --twitter-name="@TwitterUsername3" --config-file=~/zuliprc

will repeat to import last 5 tweets from two TwitterUsernames from the list every five minutes. Only one TwitterUsername will behave as expected and his tweets will not be duplicated.

@strifel proposed this solution:
You could try changing line 114 in /usr/local/share/zulip/integrations/twitter/twitter-bot from

CONFIGFILE_INTERNAL = os.path.expanduser("~/.zulip_twitteruserrc_fetchuser")

to

CONFIGFILE_INTERNAL = os.path.expanduser("~/.zulip_twitteruserrc_fetchuser_" + opts.twitter_name.replace('@', ''))

It solved the problem so I suggest to embed this code to twitter-bot if this don't affect using twitter-bot with only one following TwitterUser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions