diff --git a/config.go b/config.go index ef43797..646ef30 100644 --- a/config.go +++ b/config.go @@ -43,6 +43,7 @@ type config struct { SyndicationTargets []string `env:"SYNDICATION" envSeparator:","` TinifyKey string `env:"TINIFY_KEY"` ActivityStreams bool `env:"ACTIVITY_STREAMS" envDefault:"false"` + JsonpubUrl string `env:"JSONPUB_URL"` } func initConfig() (err error) { @@ -124,6 +125,10 @@ func initConfig() (err error) { token: cfg.MicroblogToken, }) } + // Jsonpub + if len(cfg.JsonpubUrl) > 0 { + socials = append(socials, &Jsonpub{url: cfg.JsonpubUrl}) + } return socials }() if SelectedSocials == nil { diff --git a/social.go b/social.go index 4b958a0..ae0fc87 100644 --- a/social.go +++ b/social.go @@ -67,3 +67,12 @@ func (social *MicroblogPub) Post(location string, text string) { req.Header.Add("Authorization", "Bearer "+social.token) _, _ = client.Do(req) } + +// Jsonpub +type Jsonpub struct { + url string +} + +func (social *Jsonpub) Post(_ string, _ string) { + _, _ = http.Post(social.url, "", nil) +} \ No newline at end of file