Jan-Lukas Else

Thoughts of an IT expert

How to do PESOS from Pocket to Micropub

Published on in 👨‍💻 Dev
Updated on
Short link: https://b.jlel.se/s/6a
⚠️ This entry is already over one year old. It may no longer be up to date. Opinions may have changed.

After thinking about it, I finally figured out how to PESOS from Pocket to my own site using IFTTT. I tried to do it in a similar way to how Charlotte Allen did this.

The first step was to retrieve an IndieAuth access token using the tool Gimme a token. Then I created a IFTTT applet with the a new favorite item on Pocket as the trigger and a Webhook to execute. I filled out the details for the Webhook as follows:

  • URL: The URL of the Micropub endpoint
  • Method: POST
  • Content-Type: application/x-www-form-urlencoded
  • Body: access_token=INDIEAUTHTOKEN&content=section: links&h=entry&category[]=Pocket&bookmark-of={{Url}}&name={{Title}}

The part with “section: links” in the body is my custom way to sort posts into blog sections like posts, thoughts, links etc. Every post created via this hook lands in the links section.

It’s a bit sad, that it isn’t possible to create a new “Recommended article” as trigger, because with this feature you can share a custom comment to the link. Favorites don’t have that.

Update 1 (reply to Charlotte Allen’s question why the URL is not escaped): I tried escaping the parts as you did, with two or three “<”, but somehow that created a strange result. Then I tried it without and somehow it worked. Seems like when the body is sent as application/x-www-form-urlencoded, it doesn’t matter if it is encoded.

Update 2 (reply to Chris Aldrich’s question): It is indeed based on Charlotte’s post.

Tags: , , ,

Jan-Lukas Else
Interactions & Comments