From a628fcfab39322f369300c5d71ff03e08c53eca4 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 13 Mar 2023 12:36:00 +0000 Subject: [PATCH] update readme and action --- .github/workflows/get_context.yml | 2 +- README.md | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/get_context.yml b/.github/workflows/get_context.yml index 5c3f2b5..3cdc3eb 100644 --- a/.github/workflows/get_context.yml +++ b/.github/workflows/get_context.yml @@ -32,7 +32,7 @@ jobs: path: artifacts - name: Get Directory structure run: ls -lR - - run: python get_context.py ${{ secrets.ACCESS_TOKEN }} ${{ vars.MASTODON_SERVER }} ${{ vars.REPLY_INTERVAL_IN_HOURS }} ${{ vars.HOME_TIMELINE_LENGTH }} + - run: python get_context.py ${{ secrets.ACCESS_TOKEN }} ${{ vars.MASTODON_SERVER }} ${{ vars.REPLY_INTERVAL_IN_HOURS }} ${{ vars.HOME_TIMELINE_LENGTH }} ${{ vars.MAX_FOLLOWINGS }} ${{ vars.USER }} - name: Upload artifacts uses: actions/upload-artifact@v3 with: diff --git a/README.md b/README.md index 3a854da..b602360 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ # Pull missing responses into Mastodon -This GitHub repository provides a GitHub action runs every 10 mins, and pulls remote replies into your instance, using the Mastodon API. It has two parts: +This GitHub repository provides a GitHub action runs every 10 mins, and has two parts: - 1. It gets remote replies to posts that users on your instance have already replied to during the last `REPLY_INTERVAL_IN_HOURS` hours, and adds them to your own server. - 2. It gets remote replies to the last `HOME_TIMELINE_LENGTH` posts from your home timeline, and adds them to your own server. +1. It can pull remote replies into your instance, using the Mastodon API. That part itself has two parts: + 2. It gets remote replies to posts that users on your instance have already replied to during the last `REPLY_INTERVAL_IN_HOURS` hours, and adds them to your own server. + 2. It gets remote replies to the last `HOME_TIMELINE_LENGTH` posts from your home timeline, and adds them to your own server. +2. It can also backfill posts from the last `MAX_FOLLOWINGS` users that you have followed. -Either part can be disabled completely, and the values for `REPLY_INTERVAL_IN_HOURS` and `HOME_TIMELINE_LENGTH` are configurable (see below). +Each part can be disabled completely, and all of the values are configurable. -**Be aware, that this script may run for a long time, if these values are too high.** Experiment a bit with what works for you, by starting with fairly small numbers (maybe `HOME_TIMELINE_LENGTH = 50`, `REPLY_INTERVAL_IN_HOURS = 12`) and increase the numbers as you see fit. +**Be aware, that this script may run for a long time, if these values are too high.** Experiment a bit with what works for you, by starting with fairly small numbers (maybe `HOME_TIMELINE_LENGTH = 200`, `REPLY_INTERVAL_IN_HOURS = 12`) and increase the numbers as you see fit. **For full context and discussion on why this is needed, read the blog post: [Pull missing responses into Mastodon](https://blog.thms.uk/2023/03/pull-missing-responses-into-mastodon?utm_source=github)** @@ -33,9 +35,14 @@ Either part can be disabled completely, and the values for `REPLY_INTERVAL_IN_HO 2. Click New Environment 3. Provide the name `Mastodon` 4. Add the following Environment Variables: - - `MASTODON_SERVER`: The domain only of your mastodon server (without `https://` prefix) e.g. `mstdn.thms.uk` - - `HOME_TIMELINE_LENGTH`: An integer number. E.g. `200`. (See above for explanation.) Set to `0` to disable this part of the script. - - `REPLY_INTERVAL_IN_HOURS`: An integer number. E.g. `24`. (See above for explanation). Set to `0` to disable this part of the script. + 1. Required for all parts of the script: + - `MASTODON_SERVER`: The domain only of your mastodon server (without `https://` prefix) e.g. `mstdn.thms.uk`. + 2. Required to pull in remote replies: + - `HOME_TIMELINE_LENGTH`: An integer number. E.g. `200`. (See above for explanation.) Set to `0` to disable this part of the script. + - `REPLY_INTERVAL_IN_HOURS`: An integer number. E.g. `24`. (See above for explanation). Set to `0` to disable this part of the script. + 3. Required to backfill posts from your last followings (new in v3.0.0): + - `MAX_FOLLOWINGS`: An integer number representing how many of your last followings you want to backfill. (e.g. `80`). Leave blank to disable this part of the script. + - `USER`: The username of the user whose followings you want to pull in (e.g. `michael` for the user `@michael@thms.uk`). Leave blank to disable this part of the script. 4. Finally go to the Actions tab and enable the action. The action should now automatically run approximately once every 10 min. ## Acknowledgments