Skip to main content

Jeremy Cherfas

A little problem with Known's Micropub endpoint

3 min read

One of the developers of Sunlit, a photo-sharing app that is part of the Micro.blog ecosystem, contacted me to say that “the images on your site have a MIME type of application/data”. I’d like to say I understood immediately what the problem was and what it meant, but I had to do some learning first. It wasn’t as simple as the extension, the bit after the filename that indicates whether it is a JPEG or PNG kind of image. Rather, it was about what my server tells your browser about the image.

To backtrack, Known stores all files as blobs that contain the actual file data, the 1s and 0s. Your browser, when it receives a post from my server, can often sniff out what kind of thing (image, audio, text etc) that blob of data represents and do a good job of showing it to you. Normally, you wouldn’t even notice. One clue is that if you right-click on an image, and ask to open it in a new tab, it actually gets downloaded instead, I suppose because the new tab doesn’t know what else to do with it.

Anyway, I confirmed that the source file for most images did not have an extension (which would have told the browser directly how to deal with it). Most, but not all. Files I had uploaded to my site directly did have an extension and the correct MIME type. The “bad” files had come from OwnYourGram or Quill, both of which are part of the joyful . They use a standard called Micropub to send things to a suitably equipped website.

It seemed unlikely that both Quill and OYG would fail to send the requisite information to identify a photo, so I went digging into the code that Known uses to decide what to do with a post sent by Micropub. I made a bit of progress but although I could see more or less what was happening, I couldn’t see how to make it right.

Fortunately Aaron Parecki, who built Quill and OwnYourGram (and so much else), was around and gave me the clue I needed to investigate: curl -I example.com/file.

One beautiful feature of Quill is that if it is sending a photo and if the receiving site has a media endpoint for receiving files (which Known does) it uploads the file, shows you a preview and tells you the location of the file. With that, the curl command shows that the temporary file has the correct description of Content-Type: image/jpeg. Once Known has processed the whole post from Quill, though, the file that contains the image shows as Content-Type: application/data.

Somewhere between receiving the temporary file from Quill and storing it permanently, Known fails to give it the proper MIME type.

I wish I knew enough to discover where the problem lies. Most likely Marcus Povey – who keeps the wheels spinning at Known – will be able to do the needful, now that I have submitted an issue. And Sunlit will be able to share my photos far and wide.

Jeremy Cherfas

2018-06-11

1 min read

It's all about power. Where the Dublin Gastronomy Symposium leads, the Oxford Symposium on Food and Cooking and the Agricultural History Society follow.

Jeremy Cherfas

2018-05-27

1 min read

@phoneboy kindly shared a screenshot of the "webmention" spam he said he had received.

As I suspected, it looks to me like common or garden spam, hence the scare quotes. Of course, I can't be absolutely certain without digging further into the actual URLs, which I'm not about to do, but everything about these comments screams pingbacks or trackbacks. And the solution is obviously Akismet which, to be honest, I am suprised Phoneboy has not already installed and activated.

The day may come when webmention spam is a thing, and people have been thinking about a protocol called Vouch for that eventuality.

Jeremy Cherfas

2018-05-21

1 min read

A couple of days ago, @phoneboy mentioned the fun he had deleting the spam webmentions he had received on WordPress.

I asked him to document them.

Now Phoneboy replies:

Once I figure out the right settings, I’ll let you know.

And I’m not sure what that means. What right settings? Doesn’t WordPress keep a copy of all comments it receives? It would be really useful to see the contents of those “spam webmentions,” where they came from, what they contained, who sent them, simply because, as I said before, so few of these imagined evils have so far been spotted in the open. Not sure what settings that requires.

Also, the irony of this question has not escaped me:

Also, where did you post this comment? Didn’t see it in micro.blog.

I posted it here. Where else would I post it?

Jeremy Cherfas

2018-05-17-02

1 min read

If you're looking for a really good introduction to the and insights into how it all works, you could do a lot worse than listen to Jeena's podcast with Martijn. They do a tip-top job of explaining for people less knowledgeable than they are, and the audio quality is very acceptable.

Jeremy Cherfas

2018-05-17

1 min read

Strangely, perhaps, given my love of tinkering with shiny, I've never been tempted by Ghost. But reading the latest birthday review surfaced this bit of wisdom.

Decentralised platforms fundamentally cannot compete on ease of setup. Nothing beats the UX of signing up for a centralised application.

But

Centralised platforms fundamentally cannot compete on power and flexibility. In the long run, nothing beats owning your technology and controlling your destiny.

Jeremy Cherfas

2018-05-07

1 min read

I think I just need to remind myself and others of the natural progresion of things.

  1. Everything not forbidden is permitted.
  2. Everything not permitted is forbidden.
  3. Everything not forbidden is compulsory

That is all.

Jeremy Cherfas

2018-04-27

1 min read

Like Tom MacWright, I too have almost no need for Google these days, with one exception: Chat. I have a couple of friends with whom I enjoy messaging, and they aren't about to go anywhere else. I already use YakYak. Is there any way I could message their GTalk without having a Google account myself?

Jeremy Cherfas

2018-04-11

1 min read

Digging into how withknown creates RSS feeds, I can see two things.

One is that for a status post, which has no title, `<title>` is a truncated version of the post content, although the level of truncation seems to vary. Not sure why.

The other is that even status posts, with a truncated `<title>`, have a full `<description>` that includes `p-name` and `e-content` and even `entry-content`.

But micro.blog does not seem to read `<description>` at least not when it is coming from my withknown RSS feed.

Puzzling.

Jeremy Cherfas

You can get good help

1 min read

I managed to fix a long-standing niggle with my practice this afternoon, thanks to some great help from cweiske and others. For the longest time Quill, a micropub client that I can use to publish here, wasn't showing me an option to syndicate directly to Twitter. That meant that I tended reply to tweets and stuff right there in the silo and not bring them back here. Fair enough, especially when a reply without context is like an egg without salt. But we figured it out, in part by that old standby of "switch it off and then switch it back on again". That got things working, and was enough of an impetus to upgrade WithKnown to the latest build. And so far, everything looks good.