From e47195b096ea813b310b73f8b174ded7f1e0c208 Mon Sep 17 00:00:00 2001 From: Austin Burk Date: Wed, 24 Aug 2022 17:32:05 -0400 Subject: [PATCH] gh workflow --- .github/workflows/update.yml | 28 ++++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/update.yml diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 0000000..2e9e47a --- /dev/null +++ b/.github/workflows/update.yml @@ -0,0 +1,28 @@ +name: Pull latest data from Mojang API + +on: + push: + workflow_dispatch: + schedule: + - cron: '25 */6 * * *' + +jobs: + scheduled: + runs-on: ubuntu-latest + steps: + - name: Check out this repo + uses: actions/checkout@v2 + - name: Fetch latest data + run: |- + node update_blocklist.js + - name: Generate todo.txt + run: |- + comm -23 <(sort -u data/current.txt) <(awk -F= '{print $1}' data/identified.txt |sort -u) | sort -u > data/todo.txt + - name: Commit and push if it changed + run: |- + git config user.name "Automated" + git config user.email "actions@users.noreply.github.com" + git add -A + timestamp=$(date -u) + git commit -m "Blocklist updated: ${timestamp}" || exit 0 + git push diff --git a/README.md b/README.md index 2bf45ee..79f20bb 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ I figured I'd try to get a more comprehensive list of the domains blocked by Moj Get a list of TLDs (idk if this is super up to date) ``` -curl -s https://raw.githubusercontent.com/umpirsky/tld-list/master/data/en/tld.txt|awk '{print $1}' > tld.txt +curl -s https://raw.githubusercontent.com/umpirsky/tld-list/master/data/en/tld.txt|grep -Po "\(\K.+?(?=\))" > tld.txt ``` Get the middle segment (part before the TLD) of all entries, excluding ddns.net, spit it out as *.string