diff options
author | KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> | 2021-11-02 16:10:57 -0300 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:53:29 -0700 |
commit | bc9051fd1a17e793647cf309c973a7feefebd98f (patch) | |
tree | bf16a2176e9129c3921ef6743a6c22781e744064 /util/util.go | |
parent | d80afd8a49f552c5dc51d8346d40809298fef11f (diff) |
down to the main package it seems
Diffstat (limited to 'util/util.go')
-rw-r--r-- | util/util.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/util/util.go b/util/util.go index 4ac8267..5ee548e 100644 --- a/util/util.go +++ b/util/util.go @@ -2,6 +2,7 @@ package util import ( "regexp" + "strings" ) func IsOnion(url string) bool { @@ -49,3 +50,16 @@ func GetActorInstance(path string) (string, string) { return "", "" } + +func GetActorFollowNameFromPath(path string) string { + var actor string + + re := regexp.MustCompile("f\\w+-") + + actor = re.FindString(path) + + actor = strings.Replace(actor, "f", "", 1) + actor = strings.Replace(actor, "-", "", 1) + + return actor +} |