https://github.com/0xydev/mdium
mdium is a Go package for downloading Medium articles as markdown files.
https://github.com/0xydev/mdium
go golang md medium parsing
Last synced: about 2 months ago
JSON representation
mdium is a Go package for downloading Medium articles as markdown files.
- Host: GitHub
- URL: https://github.com/0xydev/mdium
- Owner: 0xydev
- License: mit
- Created: 2025-02-19T08:53:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-19T17:16:05.000Z (over 1 year ago)
- Last Synced: 2025-05-22T04:39:25.042Z (about 1 year ago)
- Topics: go, golang, md, medium, parsing
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mdium
mdium is a Go package for downloading Medium articles as markdown files.
[](README.md)
[](README_TR.md)
## Tech Stack
[](https://go.dev/)
[](https://pkg.go.dev/github.com/0xydev/mdium)
[](https://goreportcard.com/report/github.com/0xydev/mdium)
[](https://en.wikipedia.org/wiki/RSS)
[](https://daringfireball.net/projects/markdown/)
[](https://yaml.org/)
## Requirements
- Go 1.23 or higher
## Installation
### As a Package
```bash
go get github.com/0xydev/mdium@v0.1.1
```
### As a Command Line Tool
```bash
go install github.com/0xydev/mdium/cmd/mdium@v0.1.1
```
## Features
- Download articles from:
- User profiles (e.g., @Medium)
- Medium blogs (e.g., blog.medium.com)
- Publications (e.g., medium.com/netflix-techblog)
- Convert articles to markdown with YAML frontmatter
- Limit the number of articles to download
- Customizable output directory
## Usage
### Command Line
```bash
# Download from a user profile
go run cmd/mdium/main.go -user Medium -output user_articles -limit 5
# Download from Medium's blog
go run cmd/mdium/main.go -domain blog.medium.com -output blog_articles -limit 3
# Download from a publication
go run cmd/mdium/main.go -domain medium.com/netflix-techblog -output pub_articles
```
### As a Package
```go
package main
import (
"log"
"github.com/0xydev/mdium"
)
func main() {
// Download from a user profile
client, err := mdium.NewClient("Medium", "articles")
if err != nil {
log.Fatal(err)
}
err = client.DownloadArticles(5)
if err != nil {
log.Fatal(err)
}
// Download from a publication
pubClient, err := mdium.NewClient("medium.com/netflix-techblog", "netflix_articles")
if err != nil {
log.Fatal(err)
}
err = pubClient.DownloadArticles(0) // Download all available articles
if err != nil {
log.Fatal(err)
}
}
```
## Output Format
Articles are saved as markdown files with YAML frontmatter:
```yaml
---
title: "Article Title"
date: 2024-02-19T10:00:00Z
link: "https://medium.com/..."
author: "Author Name"
---
Article content in markdown...
```
## Limitations
- Medium's RSS feed is limited to the latest 10 articles
- Some Medium articles might have formatting differences when converted to markdown
## License
MIT License - see [LICENSE](LICENSE) file for details