Change quotePostFormat
This commit is contained in:
parent
04e29ed525
commit
3a03a056e9
1 changed files with 4 additions and 3 deletions
5
main.go
5
main.go
|
@ -30,6 +30,7 @@ const (
|
||||||
serverAddr = "wss://jetstream2.us-west.bsky.network/subscribe"
|
serverAddr = "wss://jetstream2.us-west.bsky.network/subscribe"
|
||||||
// serverAddr = "wss://stream.zio.blue/subscribe"
|
// serverAddr = "wss://stream.zio.blue/subscribe"
|
||||||
postFormat = "%s\n—\n<a href=\"https://bsky.app/profile/%s/post/%s\">🦋 @%s</a>"
|
postFormat = "%s\n—\n<a href=\"https://bsky.app/profile/%s/post/%s\">🦋 @%s</a>"
|
||||||
|
quotePostFormat = "<blockquote>%s</blockquote>\n<a href=\"https://bsky.app/profile/%s/post/%s\">➡️ @%s</a>\n—\n<a href=\"https://bsky.app/profile/%s/post/%s\">🦋 @%s</a>"
|
||||||
)
|
)
|
||||||
|
|
||||||
type handler struct {
|
type handler struct {
|
||||||
|
@ -178,7 +179,7 @@ func (h *handler) ProcessPost(event *models.Event) error {
|
||||||
if ps.Embed.Record.Type == "app.bsky.embed.record" {
|
if ps.Embed.Record.Type == "app.bsky.embed.record" {
|
||||||
handle, _ := h.bsky.GetHandleFromDID(strings.Split(ps.Embed.Record.Record.URI, "/")[2])
|
handle, _ := h.bsky.GetHandleFromDID(strings.Split(ps.Embed.Record.Record.URI, "/")[2])
|
||||||
captionText = fmt.Sprintf(
|
captionText = fmt.Sprintf(
|
||||||
"<blockquote>%s</blockquote>\n<a href=\"https://bsky.app/profile/%s/post/%s\">➡️ @%s</a>\n—\n<a href=\"https://bsky.app/profile/%s/post/%s\">🦋 @%s</a>",
|
quotePostFormat,
|
||||||
ps.ProcessFacets(),
|
ps.ProcessFacets(),
|
||||||
strings.Split(ps.Embed.Record.Record.URI, "/")[2],
|
strings.Split(ps.Embed.Record.Record.URI, "/")[2],
|
||||||
strings.Split(ps.Embed.Record.Record.URI, "/")[4],
|
strings.Split(ps.Embed.Record.Record.URI, "/")[4],
|
||||||
|
@ -189,7 +190,7 @@ func (h *handler) ProcessPost(event *models.Event) error {
|
||||||
} else {
|
} else {
|
||||||
handle, _ := h.bsky.GetHandleFromDID(strings.Split(ps.Embed.Record.URI, "/")[2])
|
handle, _ := h.bsky.GetHandleFromDID(strings.Split(ps.Embed.Record.URI, "/")[2])
|
||||||
captionText = fmt.Sprintf(
|
captionText = fmt.Sprintf(
|
||||||
"<blockquote>%s</blockquote>\n<a href=\"https://bsky.app/profile/%s/post/%s\">➡️ @%s</a>\n—\n<a href=\"https://bsky.app/profile/%s/post/%s\">🦋 @%s</a>",
|
quotePostFormat,
|
||||||
ps.ProcessFacets(),
|
ps.ProcessFacets(),
|
||||||
strings.Split(ps.Embed.Record.URI, "/")[2],
|
strings.Split(ps.Embed.Record.URI, "/")[2],
|
||||||
strings.Split(ps.Embed.Record.URI, "/")[4],
|
strings.Split(ps.Embed.Record.URI, "/")[4],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue