You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Schedule daily tweets from markdown files in your repo, posted to twitter via github actions.
2
+
Schedule tweets from markdown files in your repo, posted to twitter via github actions.
3
+
3
4
4
5
## Why
5
6
- View, edit, and post your tweets without logging into twitter
6
7
- Keep source controlled backups of your tweets
7
8
- Free and open source
8
9
10
+
9
11
## Setup
10
-
1.Fork this repo
11
-
2. Get your twitter credentials by creating an app (https://developer.twitter.com/apps)
12
+
1.Clone this repo and push it to your own private repo.
13
+
2. Get your credentials by creating a twitter app (https://developer.twitter.com/apps)
12
14
3. Add your twitter credentials to the repository's secrets (https://docs.github.com/en/actions/reference/encrypted-secrets)
13
15
- API_KEY (known as consumer_key in twitter API)
14
16
- API_SECRET_KEY (known as consumer_secret in twitter API)
15
17
- ACCESS_TOKEN
16
18
- ACCESS_TOKEN_SECRET
17
19
18
-
## Scheduling Tweets
19
-
**By Date**.
20
-
1. Create a markdown file in the `./tweets/` folder with a future date in `YYYY-Mon-DD` format, for example, `2021-Sep-05.md`, and write the content of your tweet in it.
20
+
21
+
## Scheduling Tweets By Date
22
+
1. Create a markdown file in the `./tweets/` folder with a future date in either the `YYYY-Mon-DD`or `Month dd, YYYY`format, for example, `2021-Sep-05.md` or `September 5, 2021.md`, and write the content of your tweet in it.
21
23
2. Commit the file(s) and push to the remote repo. When the daily action runs on the specified date, the tweet should be posted.
22
24
23
25
@@ -28,15 +30,16 @@ Schedule daily tweets from markdown files in your repo, posted to twitter via gi
28
30
2. Changing the tweet directory:
29
31
- Change the `FILE_PATH` environment variable in `.github/workflows/go.yml`
30
32
33
+
31
34
## Running locally
32
35
1. rename `.env-SAMPLE` to `.env` and fill in your twitter credentials
33
36
- consumer_key == API_KEY
34
37
- consumer_secret == API_SECRET_KEY
35
-
2. In your terminal: `go run main.go`
38
+
2. In your terminal, from the root directory: `go run .`
39
+
36
40
37
41
## Notes
38
42
1. Fails silently on bad credentials, make sure you set those correctly.
39
43
2. Only allows one tweet per day by design. If requested, this can be modified to allow tweets by the minute or hour.
40
-
3. I suggest moving posted tweets that have already been posted to a `posted/` subdirectory under `tweets/`.
41
-
4. Tweets will not be posted exactly at the cron time set in `go.yml` because of how github actions work. If you need minute precision, run this script locally on a cronjob.
44
+
3. Tweets will not be posted exactly at the cron time set in `go.yml`. In my experience in can be 5-10 minutes late. If you need minute precision, run this script locally on a cronjob.
0 commit comments