twitter全自动发推_我如何在5分钟内自动创建FreeCodeCampers的Twitter列表

twitter全自动发推

by Monica Powell

莫妮卡·鲍威尔(Monica Powell)

我如何在5分钟内自动创建FreeCodeCampers的Twitter列表 (How I automatically created a Twitter List of FreeCodeCampers in 5 minutes)

使用Twython Twitter API包装器将用户添加到Twitter列表 (Using Twython Twitter API wrapper to add users to a Twitter List)

We are going to create a Python script that will automatically search Twitter for individuals who use the #freeCodeCamp hashtag and add them to a Twitter list of “FreeCodeCampers”. Twitter lists are a way to curate a group of individuals on Twitter and collect all of their tweets in a stream, without having to follow each individual accounts. Twitter lists can contain up to 5,000 individual Twitter accounts.

我们将创建一个Python脚本,该脚本将自动在Twitter上搜索使用#freeCodeCamp标签的个人,并将其添加到“ FreeCodeCampers”的Twitter列表中。 Twitter列表是一种在Twitter上策划一组个人并在流中收集其所有tweet的方式,而不必关注每个个人帐户。 Twitter列表最多可以包含5,000个单独的Twitter帐户。

We can accomplish this by doing the following:

我们可以通过执行以下操作来完成此任务:

  • Installing the necessary Python packages

    安装必要的Python软件包
  • Registering an application with Twitter

    在Twitter上注册应用程序
  • Generating and accessing our Twitter credentials

    生成和访问我们的Twitter凭证
  • Making Twitter Search and List API calls

    进行Twitter 搜索列出 API调用

So lets get started.

因此,让我们开始吧。

1.安装必要的Python软件包 (1. Installing the necessary Python packages)

Create a file named addToFreeCodeCampList.py, that will contain our main script and then import two Python modules into this file:

创建一个名为addToFreeCodeCampList.py的文件,该文件将包含我们的主脚本,然后将两个Python模块导入该文件:

  • Import Config: In the same directory as ouraddToFreeCodeCampList.py script, create a file named config.py that stores our confidential Twitter API credentials. We are going to import our API credentials from that file into our addToFreeCodeCampList.py script by including the line import config. Twitter requires a valid API key, API secret, access token and token secret for all API requests.

    导入配置:

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值