www.byjp.me/tools/syndicate/shared/syndicationid.go
JP Hastings-Spital c135910850 Working pixelfed & insta posting
Syndicate is working! Instagra & Pixelfed demonstrated with the new post attached.

Lots of TODOs, but functional enough :)
2023-11-12 07:43:08 +00:00

23 lines
428 B
Go

package shared
import (
"regexp"
"strings"
)
type SyndicationID struct {
Source string
ID string
}
func (sid SyndicationID) String() string {
return "syndicate:" + sid.Source + ":" + sid.ID
}
func (sid SyndicationID) Bytes() []byte {
return []byte(sid.String())
}
func TagMatcher(serviceTags []string) (*regexp.Regexp, error) {
return regexp.Compile("syndicate:(" + strings.Join(serviceTags, "|") + `):(\S+)`)
}