The basic setup is very similar to the setup explained in detail here. Check out this tutorial in order to learn how to set up a Twitter developer account and what the different parts of the code do.
A quick primer on how to parse a googlesheet, can be seen here.
The tutorial I used to set up the serverless bot is this one
For the deployment to work, you need to install the gcloud SDK command line interface on your local machine
First, you need to authenticate:
gloud auth login
Then, development is done by sourcing the file deploy.sh. In order for this to work, you need to create a new file called .env.yaml that has the same content as the .env file, but in a .yaml format. For an overview of how that looks like, see here.
Before the deploy.sh script will work, you have to run schedule.sh and go throught the command line steps in order to configure the automatic schedule. Read more here.
The project in both schedule.sh and deploy.sh is the name of the project created in the Google Cloud Console. The entry point in schedule.sh is the function in main.py that will be executed (here it is post_tweet())
You can read error logs by running gcloud functions logs read --project=daily-electro (replace daily-electro with your project name)
For more infos on how to deploy, see here
After deployment, you can test your function by triggering it here.
Inspiration for this project comes from Sam Abbott's R Daily Cheat Sheet Bot