diff --git a/README.md b/README.md new file mode 100644 index 0000000..afd7c4f --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Tampermonkey Scripts + +Personal collection of userscripts. Click **Install** to add to Tampermonkey. + + +| Script | Description | | +|--------|-------------|-| +| **IHSS Timesheet Autofill** | Auto-populate IHSS timesheet hours with random distribution | [Install](https://git.jeirslab.xyz/jeirmeister/tampermonkey-scripts/raw/branch/master/scripts/ihss-autofill.user.js) | + diff --git a/generate-readme.sh b/generate-readme.sh new file mode 100644 index 0000000..83b1974 --- /dev/null +++ b/generate-readme.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Updates the scripts table in README.md between SCRIPTS:START and SCRIPTS:END markers. +# Scrapes @name and @description from each .user.js file in scripts/ + +REPO_RAW_BASE="https://git.jeirslab.xyz/jeirmeister/tampermonkey-scripts/raw/branch/master" +README="README.md" + +# Build the table +TABLE="| Script | Description | | +|--------|-------------|-|" + +for script in scripts/*.user.js; do + [ -f "$script" ] || continue + + name=$(grep -m1 '@name' "$script" | sed 's/.*@name\s*//') + desc=$(grep -m1 '@description' "$script" | sed 's/.*@description\s*//') + raw_url="${REPO_RAW_BASE}/${script}" + + TABLE="${TABLE} +| **${name}** | ${desc} | [Install](${raw_url}) |" +done + +# Replace everything between the markers +awk -v table="$TABLE" ' + // { print; print table; skip=1; next } + // { skip=0 } + !skip { print } +' "$README" > "${README}.tmp" && mv "${README}.tmp" "$README" + +echo "Updated $README" diff --git a/scripts/ihss-autofill.user.js b/scripts/ihss-autofill.user.js index 6ded565..ef35465 100644 --- a/scripts/ihss-autofill.user.js +++ b/scripts/ihss-autofill.user.js @@ -7,6 +7,8 @@ // @grant GM_getValue // @grant GM_setValue // @run-at document-idle +// @downloadURL https://git.jeirslab.xyz/jeirmeister/tampermonkey-scripts/raw/branch/master/scripts/ihss-autofill.user.js +// @updateURL https://git.jeirslab.xyz/jeirmeister/tampermonkey-scripts/raw/branch/master/scripts/ihss-autofill.user.js // ==/UserScript== (function () {