【问题标题】:How can I change a user's Twitter name with a bot?如何使用机器人更改用户的 Twitter 名称?
【发布时间】:2015-12-03 07:52:50
【问题描述】:

我正在尝试找出是否可以通过软件更改您的 Twitter 名称。 我正在尝试制作一个程序,它每天都会以我的名义递减一个数字。

例如,10 月 3 日我的名字可能是“Spam - 5”,但 10 月 4 日可能是“Spam - 4”。

最好用 Python 2.7.x 完成

【问题讨论】:

    标签: python twitter bots


    【解决方案1】:

    您可以使用POST account/update_profile API 端点来更新您的 Twitter 用户名。详情请见the relevant documentation

    【讨论】:

      【解决方案2】:

      您需要创建一个与您的帐户关联的Twitter Application 以获取所需的 OAuth 密钥。

      使用python-twitter

      import time, twitter
      
      api = twitter.Api(consumer_key='CONSUMER_KEY_HERE', consumer_secret='CONSUMER_SECRET_HERE', access_token_key='ACCESS_TOKEN_HERE', access_token_secret='ACCESS_TOKEN_SECRET_HERE')
      
      i = 0
      while True:
          api.UpdateProfile(name=str(i))
          i += 1
          time.sleep(60 * 60 * 24) # 1 day
      

      【讨论】:

      • 我在使用 Twitter 模块时遇到问题,它给了我一个 ImportError 请求。
      猜你喜欢
      • 2018-04-04
      • 2018-11-15
      • 2018-07-10
      • 1970-01-01
      • 2019-02-20
      • 1970-01-01
      • 2021-02-23
      • 2021-11-01
      • 2018-10-15
      相关资源
      最近更新 更多