3

instance.sh:

#!/bin/bash

MY_INSTANCE=lemmy.world #change to your URL

STR=$( echo "$1" | sed 's#/c/# #' | sed 's/http[s]:\/\///' )
OTHER_INSTANCE=$( echo $STR | cut -d ' ' -f 1 )
COMMUNITY=$( echo $STR | cut -d ' ' -f 2 )
termux-open-url $( echo https://$MY_INSTANCE/c/$COMMUNITY\@$OTHER_INSTANCE )

Usage: instance.sh URL

Example usage:

instance.sh https://lemmy.ml/c/technology

Result:

https://lemmy.world/c/technology@lemmy.ml opens in browser

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here
this post was submitted on 23 Jun 2023
3 points (100.0% liked)

Termux

107 readers
1 users here now

founded 1 year ago
MODERATORS