[PYTHON] I made a bot to post on twitter by web scraping a dynamic site with AWS Lambda (continued)

Twitter bot made in 2018/10 has been refactored. The reason is

Because of the above, AWS's one-year free period is over, so I recreated the account while I was recreating it. The source code is here. The outline of the repository structure is as follows.

.
├── lambda (Lambda body)
│ ├── Modules to include
│   ├── lambdafunction.py
│   └── serverless.yml
│ 
└── selenium-layer (For Lambda Layer)
    ├── chrome-driver
    ├── selenium
    └── serverless.yml

I was impressed that Serverless Framework was too easy.

Prerequisites

serverless installed (node.js v4 or above required) AWS account acquired aws-cli installed and configured

How to use

First, upload the selenium + chromium that caused the source code bloat to Lambda Layer.

$ cd selenium-layer
$ sls deploy

After that, upload the Lambda main unit

$ cd ../lambda
$ sls deploy

That's all.

Recommended Posts

I made a bot to post on twitter by web scraping a dynamic site with AWS Lambda (continued)
I made a Twitter Bot with Go x Qiita API x Lambda
I wrote a script to create a Twitter Bot development environment quickly with AWS Lambda + Python 2.7
[AWS] I made a reminder BOT with LINE WORKS
I made a Twitter BOT with GAE (python) (with a reference)
I want to AWS Lambda with Python on Mac!
[AWS] I made a reminder BOT with LINE WORKS (implementation)
I made a program to collect images in tweets that I liked on twitter with Python
Build a Flask / Bottle-like web application on AWS Lambda with Chalice
I made a web server with Raspberry Pi to watch anime
I made a Twitter bot that mutters Pokemon caught by #PokemonGO
Serverless scraping on a regular basis with AWS lambda + scrapy Part 1
Regularly post to Twitter using AWS lambda!
I made a WEB application with Django
I tried to delete bad tweets regularly with AWS Lambda + Twitter API
I tried to make "Sakurai-san" a LINE BOT with API Gateway + Lambda
I wrote a Slack bot that notifies delay information with AWS Lambda
I made a stamp substitute bot with line
I made a Twitter fujoshi blocker with Python ①
I made a LINE Bot with Serverless Framework!
Steps to create a Twitter bot with python
I tried to reduce costs by starting / stopping EC2 collectively on AWS Lambda
I tried to use Twitter Scraper on AWS Lambda and it didn't work.
I made a Mattermost bot with Python (+ Flask)
I tried to make the weather forecast on the official line by referring to the weather forecast bot of "Dialogue system made with python".
It was a life I wanted to OCR on AWS Lambda to locate the characters.
Dynamic HTML pages made with AWS Lambda and Python
I made a household account book bot with LINE Bot
I made a Python3 environment on Ubuntu with direnv.
I made a LINE BOT with Python and Heroku
Procedure for creating a Line Bot on AWS Lambda
I want to bind a local variable with lambda
I tried to automatically generate OGP of a blog made with Hugo with tcardgen made by Go
I made a class to get the analysis result by MeCab in ndarray with python
How to deploy a web app made with Flask to Heroku
I made a LINE BOT that returns parrots with Go
I made a package to filter time series with python
(Failure) Deploy a web app made with Flask on heroku
[Introduction to AWS] A memorandum of building a web server on AWS
I just built a virtual environment with AWS lambda layer
I made you to execute a command from a web browser
Stock price plummeted with "new corona"? I tried to get the Nikkei Stock Average by web scraping
Web scraping using AWS lambda
I made a discord bot
A story that I was addicted to calling Lambda from AWS Lambda.
Move CloudWatch logs to S3 on a regular basis with Lambda
I made a library to easily read config files with Python
I tried to make a 2channel post notification application with Python
[Introduction] I want to make a Mastodon Bot with Python! 【Beginners】
Launched a web application on AWS with django and changed jobs
I made a Discord chat reading bot by imitating the appearance
I tried to log in to twitter automatically with selenium (RPA, scraping)
How to create a serverless machine learning API with AWS Lambda
I made a POST script to create an issue on Github and register it in the Project
I made a music bot using discord.py and Google Drive API (tested with Docker → deployed to Heroku)
[GPT-2] I tried to make a fake Trump president's bot by fine-tuning President Trump's Twitter with GPT-2, which is talked about as "too dangerous".
I made a C ++ learning site
I made a wikipedia gacha bot
I tried web scraping with python.
[Lambda] [Python] Post to Twitter from Lambda!
I made a fortune with Python.