I like
There probably is a legit use case somewhere here... You just need to look harder.
- Perhaps you want to tweet your application service status every hour via a health check API?
- You could post a tweet every time is a PR is merged into your master branch?
- You could post cat images every hour instead!?
The sky's the limit!
-
Clone this repo to your machine.
-
Create a
.env
in the root directory. -
Inside the
.env
you will need to create four variables.CONSUMER_KEY
,CONSUMER_SECRET
,ACCESS_TOKEN_KEY
andACCESS_TOKEN_SECRET
. These need to be populated with your own Twitter API keys which you can get by signing up at https://developer.twitter.com/ . -
Your
.env
file should look something like this.
CONSUMER_KEY = hvdVM7ZGshibasaresogreat3ZvE5tXh0E4h
CONSUMER_SECRET = 4ez9dEyAeGtbnXeca-ha-ha-M0i5wI02e1vPa
ACCESS_TOKEN_KEY = 8185583706135142-not-a-real-key-gPwxau3Yi0adA
ACCESS_TOKEN_SECRET = wow-fsaa2muchwoof
- You can then run
npm run dev-shibe
to run the script locally.
Feel free to adapt this script for your own purposes.
The hourly schedule is configured in ./.github/workflows/daily-question.yml
.
All the logic to fetch a Shiba image and post to Twitter is in ./index.js
.
⚠ Do NOT publish your
.env
to GitHub. Doing this will let anyone send posts to your Twitter account on your behalf.
- Add your Twitter API as GitHub secrets like so: