Harish
Harish

Reputation: 2324

Twitter Error Could not post Tweet

What could be this Error?

Could not post Tweet. Error: 403 Reason: Status is a duplicate. 

actually this is a edited message . i get error code as 403 and Reason as Status is a duplicate.

Upvotes: 4

Views: 7391

Answers (4)

mitm
mitm

Reputation: 31

  import time, os, random, hashlib, datetime

  gettime = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
  random_data = os.urandom(128)
  hash = hashlib.md5(gettime).hexdigest()[:8]
  twitterpost = "foo bar %s" % hash
  api.update_status(status=twitterpost)

Upvotes: 0

Kailas
Kailas

Reputation: 7578

I also had encountered the same error. what the twitter site says is that they check the messages tweeted and discard (refuse) them if they are same. Discussion here says to use different texts each time you make a tweet. Else use a different account for tweeting.

Upvotes: 0

Heiko Rupp
Heiko Rupp

Reputation: 30934

Twitter checks messages if they are duplicates of the previous and does not accept them a second time.

So for testing you need to generate new messages (=content) each time.

This is documented somewhere at Twitter, but you can also read about on other sites.

Upvotes: 5

Arvin
Arvin

Reputation: 2282

The status is a duplicate, probably running your script twice without changing the status message.

Delete your last status update via Twitter web and run the script again. Or include date('r') or md5(mt_rand()) with your status message to generate a different one each time the script is run.

Upvotes: 4

Related Questions