Twitter Error Could not post Tweet

蓝咒 提交于 2019-12-07 08:59:29

问题


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.


回答1:


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.




回答2:


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.




回答3:


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.




回答4:


  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)


来源:https://stackoverflow.com/questions/4874532/twitter-error-could-not-post-tweet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!