aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/util.go14
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
+}