summaryrefslogtreecommitdiffstats
path: root/indieweb-micro
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-12-03 02:55:23 -0800
committerPinapelz <yukais@pinapelz.com>2025-12-03 02:55:23 -0800
commitef0e2cfb699e9630d8caaa4cf61eb72c66be3b85 (patch)
tree8efedbb618bd24c1b1044a02705eeac4cb1b2f00 /indieweb-micro
parentb6ee018317b97951bbd2630b1d0e009dbbadf2ff (diff)
add make-follow script
Diffstat (limited to 'indieweb-micro')
-rw-r--r--indieweb-micro/content/indie/follows.md3
-rwxr-xr-xindieweb-micro/make-follow.sh30
2 files changed, 33 insertions, 0 deletions
diff --git a/indieweb-micro/content/indie/follows.md b/indieweb-micro/content/indie/follows.md
index 2731ce8..ec34ae6 100644
--- a/indieweb-micro/content/indie/follows.md
+++ b/indieweb-micro/content/indie/follows.md
@@ -14,6 +14,9 @@ This is mostly here for pages that can receive [Webmentions](https://indieweb.or
{{< follow "https://sakurajima.moe/@chikorita157" "2025-12-03" >}}
{{< follow "https://misskey.io/@CAP_Tw" "2025-12-03" >}}
{{< follow "https://misskey.io/@meeeeeeco" "2025-12-03" >}}
+{{< follow "https://sakurajima.moe/@sakurajima" "2025-12-03" >}}
+{{< follow "https://mi.shiromaru.work/@ovoip" "2025-12-03" >}}
+{{< follow "https://floss.social/@kde" "2025-12-03" >}}
## Bluesky
{{< follow "https://bsky.app/profile/mofu.run" "2025-12-03" >}}
diff --git a/indieweb-micro/make-follow.sh b/indieweb-micro/make-follow.sh
new file mode 100755
index 0000000..b72fc9d
--- /dev/null
+++ b/indieweb-micro/make-follow.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+# Get today's date in the required format
+today=$(date '+%Y-%m-%d')
+
+# Check if URL is provided as argument
+if [ $# -eq 0 ]; then
+ echo "Usage: $0 <url>"
+ echo "Example: $0 https://sakurajima.moe/@sakurajima"
+ exit 1
+fi
+
+url="$1"
+
+# Append https if not present
+if [[ ! $url =~ ^https?:// ]]; then
+ url="https://$url"
+fi
+
+# Check if URL matches the pattern https://domain/@user@remote.domain
+if [[ $url =~ ^https://[^/]+/@[^@]+@([^/]+)$ ]]; then
+ # Extract the username and remote domain
+ username=$(echo "$url" | sed 's/.*\/@\([^@]*\)@.*/\1/')
+ remote_domain="${BASH_REMATCH[1]}"
+ # Remap to https://remote.domain/@username
+ url="https://$remote_domain/@$username"
+fi
+
+# Generate the follow shortcode
+echo "{{< follow \"$url\" \"$today\" >}}"
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage