aaronpk / webmention.io

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

"empty" webmentions #36

Closed thedod closed 9 years ago

thedod commented 9 years ago

As mentioned here, I tried to webmention from github, got a 202, and nothing happened.

I tried again now, got the 202 below,

$ curl -i \
  -d 'source=https://github.com/aaronpk/self/issues/3&target=https://zzzen.com/420/' \
  https://webmention.io/zzzen.com/webmention
HTTP/1.1 202 Accepted
Content-Type: application/json;charset=UTF-8
Content-Length: 38
Connection: keep-alive
Status: 202 Accepted
Cache-Control: no-store
Access-Control-Allow-Origin: *
X-Content-Type-Options: nosniff
X-Powered-By: Phusion Passenger 4.0.38
Date: Sun, 14 Dec 2014 04:48:04 GMT
Server: nginx/1.4.6 + Phusion Passenger 4.0.38

but this time (4 days and many commits later), it does appear, but both this webmention and the one preceding it (which was fine yesterday) don't have name, content or URL in the JSON:

        {
            "activity": {
                "sentence": null,
                "sentence_html": null,
                "type": null
            },
            "data": {
                "content": null,
                "name": null,
                "published": null,
                "published_ts": null,
                "url": null
            },
            "id": 12652,
            "source": "http://indiewebcamp.com/irc/2014-12-12/line/1418415395410",
            "target": "https://zzzen.com/420/",
            "verified": true,
            "verified_date": "2014-12-12T20:39:04+00:00"
        },
        {
            "activity": {
                "sentence": null,
                "sentence_html": null,
                "type": null
            },
            "data": {
                "content": null,
                "name": null,
                "published": null,
                "published_ts": null,
                "url": null
            },
            "id": 12613,
            "source": "https://github.com/aaronpk/self/issues/3",
            "target": "https://zzzen.com/420/",
            "verified": true,
            "verified_date": "2014-12-14T04:48:04+00:00"
        },
thedod commented 9 years ago

Fixed WebmentionDressing to use source instead of [sometimes missing] data.url. I see you've closed aaronpk/self#3, so I've reopened it as indieweb/wiki#18 :wink:

aaronpk commented 9 years ago

It is expected that "data" is blank for the Github URL, since the data object is populated by parsing the microformats2 markup on the page. If none is found, it will be empty. It should have found some microformats on the indiewebcamp URL so I'll look into that.

thedod commented 9 years ago

the data object is populated by parsing the microformats2 markup on the page

Thanks. So using source is not a bad choice then (although I guess the proper thing would be to prefer data.url and use source as a fallback).

aaronpk commented 9 years ago

Yeah, I'd recommend using data.url if it's there, and fall back to source. This is especially apparent with bridgy, where the source will be the brid.gy URL and the data.url will be the actual Twitter URL for example.

thedod commented 9 years ago

Pushed this, and I see the difference at the demo on the 15 Dec 2014 00:41:37 GMT fav by marek 'saji' aug.. The link is to the tweet. The older twitter favs point to brid.gy items. Probably something changed as brid.gy (or webmention.io's mf2 parser) early December.

It should have found some microformats on the indiewebcamp URL so I'll look into that

I leave the issue open in case you want it left as a reminder for that "mf2 mystery", but as far as I'm concerned, feel free to close it. indieweb/wiki#18 is the one that counts, especially now that the code is "even better then before" :wink: