Home / GitHub Page

Ghoplin - A tool for downloading posts from Ghost blogs into Joplin

I’ve made a tool to copy posts from my Ghost blogs into Joplin. Here is a short overview; it’s a part of its GitHub ReadMe.


Why?

Joplin keeps my notes. Many of my blog posts are just neater summaries of my notes or the things I’ve learned. When I search Joplin, I want all of my blog posts to be included in the search as well. The downloaded notes contain original post URLs, tags and the Created and Modified timestamps are set to the date of post publication.

How?

First tell Ghoplin about all the Ghost blogs you want to sync; then run sync. Let Ghoplin download all posts.

Since I like my E2EE and don’t want an unencrypted version of my notes leaving my devices, the app has to run locally. Therefore it’s a simple terminal app you have to run locally.

Tested on Windows and Linux (Ubuntu on WSL, to be precise). Since it’s written in .NET Core 3.1, it should run wherever it runs, though.

Usage - quickstart

Download the appropriate file from the Releases page. The commands below are same regardless of platform, the only difference is that e.g. in Powershell on Windows the invocation will look like .\Ghoplin.exe <command>, whereas in Fish on Ubuntu it’ll be ./Ghoplin <command>.

To get help for any command, try something like Ghoplin help, Ghoplin add help etc.

1. Specify Joplin API token

First you have to let Ghoplin talk to your Joplin, which has to be running when Ghoplin runs.

You can either input your token (and port, if non-default) every time you run Ghoplin by passing it in a parameter, i.e. appending -t thisIsMyToken546168135413243 to each command.

Or you can save your token into a config file that will be placed next to the executable. The easiest way to write this file is by running:

Ghoplin write-config -t thisIsMyToken546168135413243

Then you no longer need to specify the token when running subsequent commands.

2. Add your blogs

For each blog you want to add, run add:

Ghoplin add --url https://zblesk.net/blog --apiKey myActualApiKeyReally235476854 --notebook "English blog"

So you need to specify the URL of your blog, your API key and the Joplin’s notebook. You can either specify Joplin’s internal notebook ID, or just specify it by name - make sure it’s the only notebook with that name, though.

If you want to apply tags to each note from this blog, use the --auto-tags argument. Feed it a comma-separated list of tags.

I.e. to tag all posts with the tag “blog” and “fun stuff”, write:

--auto-tags "blog,fun stuff"

3. Run Sync

Then just run:

Ghoplin sync

This downloads all the posts from the blog in chronological order.

When you later want to add newer posts, just re-run Ghoplin sync. It remembers the time of last sync for each blog and will only download new posts.


This is a part of the entire ReadMe. Worked well for me so far.

1 Like

I’ve encountered a few weird network issues when using the Joplin API - sometimes after a single POST to create a note, the note was created twice. (That seems to have disappeared on its own after a time, though.)

Way more often when posting a note I get a The response ended prematurely error. Not sure where the error is, though - whether in my code, some in the libraries I use, or in Joplin. Even when this happens, or when I get the occasional 500 from the API the note most often is created anyway, so I’ve written a workaround to deal with it.

Still, weird. Did anyone else encounter this?

(Even if the errors happened quite regularly, I don’t have any useful repro steps - when I start Fiddler to capture the HTTP traffic, the errors disappear.)