mirror of
https://github.com/by-jp/www.byjp.me.git
synced 2025-08-09 18:06:07 +01:00
Syndicate is working! Instagra & Pixelfed demonstrated with the new post attached. Lots of TODOs, but functional enough :)
23 lines
428 B
Go
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+)`)
|
|
}
|