golang微信机器人_如何使用Golang从头开始创建Twitter机器人

golang微信机器人

by Kofo Okesola

由Kofo Okesola

如何使用Golang从头开始创建Twitter机器人 (How to create a Twitter bot from scratch with Golang)

So a little background: I recently picked up Golang and decided to create a Twitter bot as a side project. Then came the problem. There is little to no documentation on using the Twitter API with Golang ?(particularly the oauth1 and CRC encryption parts of it). So after some days of trial and error and finally completing it, I want to share the process. Hopefully, this helps someone out there.

有一点背景知识:我最近选择了Golang并决定创建一个Twitter机器人作为辅助项目。 然后出现了问题。 几乎没有关于将Twitter API与Golang一起使用的文档(尤其是其中的oauth1和CRC加密部分)。 因此,经过几天的试验和错误并最终完成了它,我想分享一下过程。 希望这可以帮助某个人。

我们要建造什么? (What are we going to build?)

We will build a Twitter bot that will be served from our local machine. It will respond to any tweet that is tagged in with a “hello world”.

我们将构建一个Twitter机器人,该机器人将通过我们的本地计算机提供服务。 它将响应标记有“ hello world”的任何推文。

Here’s a brief explanation as to what this go program will do. It will:

这是有关此go程序将执行的操作的简要说明。 它会:

  • Listen and respond to webhook CRC validation.

    侦听并响应webhook CRC验证

  • Register a webhook URL that points to it.

    注册指向它的webhook URL。
  • Listen for tweets and respond with “hello world”.

    听推文并用“ hello world”回复。

你需要什么? (What do you need?)

  • Some basic knowledge of Golang

    Golang的一些基本知识
  • An approved Twitter developer account. How to apply.

    批准的Twitter开发人员帐户。 如何申请

  • You should have an account activity API dev environment set up — call it dev for this project

    您应该设置一个帐户活动API开发环境-将此项目称为dev

  • A Twitter app with generated consumer keys and access tokens (Read and write access)

    具有生成的使用者密钥和访问令牌(读取和写入访问权限)的Twitter应用

  • Go

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值