Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imteekay/m2m
Transform a Medium post into a Markdown file
https://github.com/imteekay/m2m
markdown medium-article parser python scraper scraping
Last synced: 3 months ago
JSON representation
Transform a Medium post into a Markdown file
- Host: GitHub
- URL: https://github.com/imteekay/m2m
- Owner: imteekay
- License: mit
- Created: 2018-11-19T21:21:14.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T02:14:34.000Z (about 2 years ago)
- Last Synced: 2024-10-04T05:41:53.772Z (3 months ago)
- Topics: markdown, medium-article, parser, python, scraper, scraping
- Language: Python
- Homepage:
- Size: 32.2 KB
- Stars: 30
- Watchers: 2
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# M2M or Medium to Markdown
A project to transform a Medium post into a Markdown file
## Environment Variables
This project uses 2 environment variables: `GITHUB_USERNAME` and `GITHUB_PASSWORD`. They are used in the `GistToCodeblock` class to authenticate user in the [Github API](https://developer.github.com/v3/gists/).
Copy the `.sample-env` and update the variables with your Github username and password
```bash
cp .sample-env .env
```## Requirements
Create your virtual environment
```bash
virtualenv m2menv
```Activate your virtualenv
```base
source m2menv/bin/activate
```Run this command to install all required libraries
```bash
pip install -r requirements.txt
```- [Python 3](https://docs.python.org/3/)
- [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/): Easily parse HTML
- [Python DotEnv](https://github.com/theskumar/python-dotenv): Store environment variables
- [Requests](https://github.com/requests/requests): Access public APIs & HTML pages## Usage
To do the Medium to Markdown transformation, call the `core.py` passing the post url
```bash
python m2m/core.py http://bit.ly/2FG5GgT
```If you not pass the post url, the `core.py` will use the default post url