willnorris / webmention

Go library and CLI for assisting in sending webmentions.
https://pkg.go.dev/willnorris.com/go/webmention
BSD 3-Clause "New" or "Revised" License
49 stars 5 forks source link

handle brid.gy response for POSSE webmentions #4

Open willnorris opened 10 years ago

willnorris commented 10 years ago

when using brid.gy as a POSSE agent, the webmention response will include data for the newly created POSSE post. It would be helpful to display some portion of this data... at the very least the URL.

It would be great if there was a generic way to do this that's not necessarily specific to brid.gy, but given that there's no standardization of successful webmention responses, hard-coding brid.gy support should be a fine place to start.

jamietanna commented 2 years ago

At least for Twitter, this is the $.url of the Webmention response. I believe this is also the case for IndieNews

nekr0z commented 2 years ago

When using the library, brid.gy's anwers are easy to get and process already:


r, err := client.SendWebmention(endpoint, source, target)
if err != nil {
    ## process error
}

if r.StatusCode == 201 {
    fmt.Printf("the URL of the created object is %s", r.Header.Get("location"))
}
jamietanna commented 2 years ago

Hmm, maybe I confused the code up.

I believe the location is meant for async processing

nekr0z commented 2 years ago

I believe the location is meant for async processing

Maybe. Yet both brid.gy and indieweb news use it, despite being all non-async.