2019-12-10 07:48:13 -05:00
|
|
|
# Seance
|
2019-10-11 07:19:33 -04:00
|
|
|
|
2019-12-10 07:48:13 -05:00
|
|
|
relay content from Medium to Ghost [WIP]
|
2019-10-11 07:19:33 -04:00
|
|
|
|
|
|
|
> **Note:** This app is still work in progress!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# installation
|
|
|
|
|
|
|
|
To install, run the following commands:
|
|
|
|
|
2019-12-10 07:48:13 -05:00
|
|
|
cd seance
|
2019-10-11 07:19:33 -04:00
|
|
|
yarn install
|
|
|
|
yarn link
|
|
|
|
|
2019-12-10 07:48:13 -05:00
|
|
|
The `seance` command should now be available in your path. If not,
|
2019-10-11 07:19:33 -04:00
|
|
|
check permissions or run `node ./index.js` directly.
|
|
|
|
|
|
|
|
# usage
|
|
|
|
|
|
|
|
The main point of this tool is to easily pull Medium posts and add them
|
|
|
|
to a Ghost site, so that you can (for example) cross-post your content
|
|
|
|
between Medium and Ghost.
|
|
|
|
|
|
|
|
This project is created for the [Snipette](https://www.snipettemag.com)
|
|
|
|
website, and as such might have some Snipette-specific features.
|
|
|
|
However, you're free to use it as you like, and any contributions are
|
|
|
|
welcome!
|
|
|
|
|
|
|
|
## Pull a post from Medium
|
|
|
|
|
|
|
|
# replace the URL with an actual Medium post
|
2019-12-10 07:48:13 -05:00
|
|
|
seance fetch https://medium.com/@username/some-post-abc123
|
2019-10-11 07:19:33 -04:00
|
|
|
|
|
|
|
This will create a new folder in `./content` containing:
|
|
|
|
|
|
|
|
* the post as a markdown file
|
|
|
|
* image files for each post (linked appropriately)
|
2019-12-10 07:48:13 -05:00
|
|
|
* a JSON file with post metadata
|
2019-10-11 07:19:33 -04:00
|
|
|
|
|
|
|
## Push a post to Ghost
|
|
|
|
|
|
|
|
# replace some-post with post directory
|
2019-12-10 07:48:13 -05:00
|
|
|
seance push content/some-post
|
2019-10-11 07:19:33 -04:00
|
|
|
|
|
|
|
Currently, this command does not do anything. We're working on it!
|
|
|
|
|
|
|
|
## Copy a Medium post directly to Ghost
|
|
|
|
|
|
|
|
# replace the URL with an actual Medium post
|
2019-12-10 07:48:13 -05:00
|
|
|
seance import https://medium.com/@username/some-post-abc123
|
2019-10-11 07:19:33 -04:00
|
|
|
|
|
|
|
This is basically the other two commands combined, so, like the `push`
|
|
|
|
command, doesn't do anything for the second part as of now.
|
|
|
|
|
|
|
|
## Import a Medium user to Ghost
|
|
|
|
|
|
|
|
# Replace username and email with appropriate values
|
|
|
|
# The username should match an existing Medium user
|
2019-12-10 07:48:13 -05:00
|
|
|
seance content username user@example.com
|
2019-10-11 07:19:33 -04:00
|
|
|
|
|
|
|
This will output a JSON object. Copy-paste that object into a new file
|
|
|
|
(eg. `ghost-import.json`), then open your Ghost Admin and import the
|
|
|
|
file via the "Labs" section. This is required becaues Ghost doesn't
|
|
|
|
let you directly add users; it only lets you import them.
|
|
|
|
|
|
|
|
# credits
|
|
|
|
|
|
|
|
* Medium import/export is inspired by and depends on a modified version
|
|
|
|
of the [mediumexporter](https://github.com/xdamman/mediumexporter)
|
|
|
|
library cum cli tool
|
|
|
|
* Image upload inspired by
|
|
|
|
[ghost-webdav-storage-adapter](https://github.com/bartt/ghost-webdav-storage-adapter),
|
|
|
|
or will be, once it's implemented
|
|
|
|
|
|
|
|
# contributing
|
|
|
|
|
|
|
|
We're developing this software internally for
|
|
|
|
[Snipette](https://www.snipettemag.com), but, if you find our tool
|
|
|
|
useful and think you can improve it, we'd be happy to have your
|
|
|
|
contributions! Just start an issue or open a pull request :)
|
|
|
|
|
|
|
|
# license
|
|
|
|
|
|
|
|
This code is released under the MIT license. See the LICENSE file for
|
|
|
|
details.
|