all repos — honk @ 78eba0bbb4c62f9e0cdd219c050760ae3f0aa54f

my fork of honk

include hashtags in AP metadata
Ted Unangst tedu@tedunangst.com
Sat, 15 Jun 2019 18:24:18 -0400
commit

78eba0bbb4c62f9e0cdd219c050760ae3f0aa54f

parent

b295e337d18dd7f70cfee5bd4d4105b531fcdeb3

2 files changed, 14 insertions(+), 0 deletions(-)

jump to
M activity.goactivity.go

@@ -733,6 +733,13 @@ t["name"] = m.who

t["href"] = m.where tags = append(tags, t) } + ooo := ontologies(h.Noise) + for _, o := range ooo { + t := junk.New() + t["type"] = "Hashtag" + t["name"] = o + tags = append(tags, t) + } herd := herdofemus(h.Noise) for _, e := range herd { t := junk.New()
M fun.gofun.go

@@ -119,6 +119,13 @@ return s

} } +var re_hashes = regexp.MustCompile(`(?:^|\W)#[[:alnum:]]+`) + +func ontologies(s string) []string { + m := re_hashes.FindAllString(s, -1) + return m +} + type Mention struct { who string where string