Home

Awesome

ZMediumToMarkdown

ZMediumToMarkdown

ZMediumToMarkdown is a powerful tool that allows you to effortlessly download and convert your Medium posts to Markdown format.

This project can help you create an auto-sync or auto-backup service from Medium, such as automatically syncing Medium posts to Jekyll or other static markdown blog engines, or backing up Medium posts to Github pages.

ZMediumToMarkdown

Features

Result

and I use this tool to convert from Meidum to jekyllrb

Setup

2023/07/17 Update 🎉

I have just created a brand new GitHub repository template that allows you to move your Medium blog to your own Jekyll blog with just one click. Check it out: ZMediumToJekyll.

I'M NOT GEEK, PLEASE SHOW ME HOW TO USE WITHOUT CODING

How to use Github Action as your free & no code Medium Posts backup service

2024/01/27 Update: Docker 🎉

  1. make sure has Docker on your system.
  2. git clone this repo git clone https://github.com/ZhgChgLi/ZMediumToMarkdown
  3. cd /ZMediumToMarkdown
  4. build docker image docker build -t zmediumtomarkdown:latest --build-arg CRON_SETTING="0 8 * * *" --build-arg ZMEDIUMTOMARKDOWN_COMMAND="-u [YOUR_MEDIUM_USERNAME]" .
    • ZMEDIUMTOMARKDOWN_COMMAND = ZMediumToMarkdown Command (Refer to the configuration block down below.)
  5. Refer to the configuration block down below and finish the configuration.
  6. run docker docker run -v ./:/usr/src/app zmediumtomarkdown
  7. have fun!

Using Gem

If you are familiar with ruby:

  1. make sure you have Ruby in your environment (I use 2.7.5)
  2. make sure you have Bundle in your environment (I use 2.3.13)
  3. type gem install ZMediumToMarkdown in terminal

If you are NOT familiar with ruby:

  1. MacOS comes with a System Ruby pre-installed, but we are NOT Recommend to use that, using rvm/rbenv's Ruby instead.
  2. install rbenv or rvm to manage Ruby environment
  3. install Ruby through rbenv/rym (you can install ruby version 2.6.X)
  4. change the systme ruby to rbenv/rvm's Ruby
  5. type which ruby in terminal to make sure current Ruby is NOT /usr/bin/ruby
  6. type gem install ZMediumToMarkdown in terminal

Usage

Command: ZMediumToMarkdown

Downloading all posts from any user

ZMediumToMarkdown -u [USEERNAME]

Downloading single post

ZMediumToMarkdown -p [MEDIUM POST URL]

Update to latest version

ZMediumToMarkdown -n

Remove all downloaded posts data

ZMediumToMarkdown -c

Print current ZMediumToMarkdown Version & Output Path

ZMediumToMarkdown -v

Provide valid Medium Member cookies to access paywall posts ZMediumToMarkdown requires uid and sid cookies to access paywalled posts on Medium.

If you don’t provide valid Medium Member cookies, you will receive this warning message while downloading a Medium post if the post is behind a paywall:

This post is behind Medium's paywall. You must provide valid Medium Member login cookies to download the full post.

ZMediumToMarkdown --cookie_uid uid --cookie_sid sid

You can obtain cookie_uid and cookie_sid from Medium by following these steps:

  1. Log in to a valid Medium Member account.
  2. Right-click anywhere on the Medium webpage.
  3. Select "Inspect" to open the Developer Tools.
  4. Navigate to the "Application" tab and locate the sid and uid values under "Cookies."

ZhgChgLi-2024-08-11_22-30-03

For Jeklly Dir Friendly

Downloading all posts from user with Jekyll friendly

ZMediumToMarkdown -j [USEERNAME]

Downloading single post with Jekyll friendly

ZMediumToMarkdown -k [MEDIUM POST URL]

Manually

  1. MacOS comes with a System Ruby pre-installed, but we are NOT Recommend to use that, using rvm/rbenv's Ruby instead.
  2. install rbenv or rvm to manage Ruby environment
  3. install Ruby through rbenv/rym (you can install ruby version 2.6.X)
  4. change the systme ruby to rbenv/rvm's Ruby
  5. type which ruby in terminal to make sure current Ruby is NOT /usr/bin/ruby
  6. type gem install bundler install RubyGem dependency manager (you can install Bundle version 2.3.x)
  7. git clone or download this project
  8. type cd ./ZMediumToMarkdown go into project
  9. type bundle install in terminal to install project dependencies
  10. use bundle exec ruby [USAGE Command] in the furture (USAGE Command write down below)

Usage

Execute File: bin/ZMediumToMarkdown

Downloading all posts from any user

bundle exec ruby bin/ZMediumToMarkdown -u [USEERNAME]

Downloading single post

bundle exec ruby bin/ZMediumToMarkdown -p [MEDIUM POST URL]

Update to latest version

bundle exec ruby bin/ZMediumToMarkdown -n

Remove all downloaded posts data

bundle exec ruby bin/ZMediumToMarkdown -c

Print current ZMediumToMarkdown Version & Output Path

bundle exec ruby bin/ZMediumToMarkdown -v

Output

Where can I find the results of the downloaded post?

The default path of the downloaded post will be in the ./Output directory.

Disclaimer

All content downloaded using ZMediumToMarkdown, including but not limited to articles, images, and videos, are subject to copyright laws and belong to their respective owners. ZMediumToMarkdown does not claim ownership of any content downloaded using this tool.

Downloading and using copyrighted content without the owner's permission may be illegal and may result in legal action. ZMediumToMarkdown does not condone or support copyright infringement and will not be held responsible for any misuse of this tool.

Users of ZMediumToMarkdown are solely responsible for ensuring that they have the necessary permissions and rights to download and use any content obtained using this tool. ZMediumToMarkdown is not responsible for any legal issues that may arise from the misuse of this tool.

By using ZMediumToMarkdown, users acknowledge and agree to comply with all applicable copyright laws and regulations.

Using Github Action as your free auto sync/backup service

name: ZMediumToMarkdown
on:
  workflow_dispatch:
  schedule:
    - cron: "10 1 15 * *" # At 01:10 on day-of-month 15.
jobs:
  ZMediumToMarkdown:
    runs-on: ubuntu-latest
    steps:
    - name: ZMediumToMarkdown Automatic Bot
      uses: ZhgChgLi/ZMediumToMarkdown@main
      with:
        command: '[USAGE Command]' # e.g. -u zhgchgli

exmaple repo

Things to know

About

Other works

Swift Libraries

Integration Tools

Donate

Buy Me A Coffe

If you find this library helpful, please consider starring the repo or recommending it to your friends.

Feel free to open an issue or submit a fix/contribution via pull request. :)