14
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AWS LambdaのSchedule Taskを使ってエゴサーチをslackに流し込む

Posted at

Lambdaでスケジュール機能(cron)が使えるようになったことで、一段とサーバレスでbotを実現できるようになってきました。
http://aws.typepad.com/aws_japan/2015/10/aws-lambda-update-python-vpc-increased-function-duration-scheduling-and-more.html

せっかくなので、twitterでエゴ・サーチした結果をslackに流し込むLambda Functionを作ってみました。

lambda_twitter.png

作り的にはこんな感じで、LambdaからTwitter APIを使ってキーワード検索を行い、その結果をSlackへpostします。
DynamoDBは最後のつぶやきのidを保持し、次回のキーワード検索ではそのid以降につぶやかれたものだけを持ってくるために利用している。

slackではこんな感じでつぶやきが表示される。
slack_post_image.png

14
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?