aaronpk / webmention.io

Easily enable webmentions on any web site
https://webmention.io/
Other
778 stars 38 forks source link

Ignore fragment part of the target URL #106

Open kaushalmodi opened 6 years ago

kaushalmodi commented 6 years ago

Hello,

This recent tweet of mine caused an interesting webmention..

The link in the tweet was to the "#webmentions" ID in that post.. not directly to that post Permalink: https://scripter.co/installing-go-toolchain/#webmentions

So when someone liked that tweet, the webmention was created for "Permalink + the #webmentions ID". Interestingly that is captured by webmention.io.. but is not retrieved via the API.

image

So https://webmention.io/api/count?target=https://scripter.co/installing-go-toolchain/ returns:

{
  "count": 1,
  "type": {
    "mention": 1
  }
}

But https://webmention.io/api/count?target=https://scripter.co/installing-go-toolchain/%23webmentions returns:

{
  "count": 1,
  "type": {
    "like": 1
  }
}

Given this, I would then need to poll all the possible subsection URLs for each post (Though I am not yet sure if I can do it using the Hugo Go templates)..

Can you please add an option to merge all the subsection mentions in the post target Permalink?

aaronpk commented 6 years ago

You're absolutely right, it should be returning these fragment ID mentions when you request the mentions of the page they're on. I will keep this issue open and work on this!

RobbiNespu commented 3 years ago

Some example for https://robbinespu.gitlab.io/posts/linux-twitter-client-cawbird

The normal version

  {
      "in-reply-to": [
          {
              "type": "entry",
              "author": {
                  "type": "card",
                  "name": "Anonymous",
                  "photo": "https://webmention.io/avatar/commentpara.de/ef200c8b639d79d1cfbc0abf0e25f42dcbc585b4398003dd90f5a56c9d56e3bf.svg",
                  "url": ""
              },
              "url": "https://commentpara.de/comment/896.htm",
              "published": null,
              "wm-received": "2021-09-05T17:01:11Z",
              "wm-id": 1263020,
              "wm-source": "https://commentpara.de/comment/896.htm",
              "wm-target": "https://robbinespu.gitlab.io/posts/linux-twitter-client-cawbird/",
              "content": {
                  "text": "RFP: Cawbird - A fork of the Corebird GTK Twitter client that continues to work with Twitter https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=993734"
              },
              "in-reply-to": "https://robbinespu.gitlab.io/posts/linux-twitter-client-cawbird/",
              "wm-property": "in-reply-to",
              "wm-private": false
          }
      ]
  }

with header-id (fragment)

  {
      "in-reply-to": [
          {
              "type": "entry",
              "author": {
                  "type": "card",
                  "name": "Anonymous",
                  "photo": "https://webmention.io/avatar/commentpara.de/ef200c8b639d79d1cfbc0abf0e25f42dcbc585b4398003dd90f5a56c9d56e3bf.svg",
                  "url": ""
              },
              "url": "https://commentpara.de/comment/895.htm",
              "published": null,
              "wm-received": "2021-09-05T16:53:22Z",
              "wm-id": 1263018,
              "wm-source": "https://commentpara.de/comment/895.htm",
              "wm-target": "https://robbinespu.gitlab.io/posts/linux-twitter-client-cawbird/#solving-ibboardopen-build-service-obs-public-key-issue",
              "content": {
                  "text": "RFP: Cawbird - A fork of the Corebird GTK Twitter client that continues to work with Twitter https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=993734"
              },
              "in-reply-to": "https://robbinespu.gitlab.io/posts/linux-twitter-client-cawbird/#solving-ibboardopen-build-service-obs-public-key-issue",
              "wm-property": "in-reply-to",
              "wm-private": false
          }
      ]
  }
snarfed commented 2 years ago

Friendly nudge! This came up recently in https://github.com/snarfed/bridgy/issues/1329#issuecomment-1285907014.