A Go-based feed collector that monitors various tech blogs and RSS feeds to collect the latest articles.
tech-newsletter-generator/
├── cmd/
│ └── collector/ # Feed collector executable
├── internal/
│ ├── config/ # Configuration file management
│ ├── feed/ # Feed fetching and processing
│ └── storage/ # Data storage operations
├── pkg/
│ └── models/ # Data models and structures
├── config/ # Configuration JSON files
├── tmp/data/ # Temporary data storage
└── .github/workflows/ # GitHub Actions workflows
- Multi-source Feed Support: Supports RSS, Atom, and various platform-specific feeds (Zenn, Qiita, Hatena, etc.)
- Intelligent Deduplication: Avoids collecting duplicate articles
- Automatic Config Updates: Updates configuration files with latest article links
- Comprehensive Testing: High test coverage with unit tests
- CI/CD Integration: GitHub Actions for automated testing and feed collection
Feed configurations are stored in JSON files under the config/ directory. Each file can contain multiple feed configurations:
{
"data": [
{
"name": "Firebase Blog",
"type": "categoryIsUrl",
"feedUrl": "https://firebase.blog/rss.xml",
"latestLink": "https://firebase.blog/posts/2025/10/fpnv-preview-launch"
}
]
}You have to register GitHub Actions Secret for sending Gmail.
- MAIL_USERNAME
- MAIL_PASSWORD
- MAIL_TO
- MAIL_FROM
MAIL_PASSWORD is Gmail App password.
categoryIsUrl: Direct RSS feed URLcategoryIsAtomUrl: Direct Atom feed URLzenn: Zenn user feed (username as feedUrl)qiita: Qiita user feed (username as feedUrl)note: Note user feed (username as feedUrl)hatena: Hatena blog feed (blog URL as feedUrl)scrapbox: Scrapbox project feed (project name as feedUrl)connpass: Connpass group feed (group name as feedUrl)
- Go 1.21 or higher
-
Clone the repository:
git clone https://github.com/your-username/tech-newsletter-generator.git cd tech-newsletter-generator -
Install dependencies:
go mod download
# Run the feed collector
go run cmd/collector/main.go
# Or use make
make run-collector# Run all tests
make test
# Run tests with coverage
make test-coverage
# Run tests with race detection
make test-raceCurrent test coverage:
- internal/config: 87.5%
- internal/feed: 93.3%
- internal/storage: 84.6%
# Format code
make fmt
# Run linter
make lint
# Run go vet
make vet# Build for current platform
make build
# Build for multiple platforms
make build-all- Runs on push/PR to master and develop branches
- Tests against Go 1.21, 1.22, and 1.23
- Generates coverage reports
- Uploads coverage to Codecov
- Runs linting and security checks
- Runs every hour automatically
- Can be triggered manually
- Collects new feeds and updates configuration files
- Commits changes back to the repository
- Load Configurations: Read all JSON files from
config/directory - Load Existing Items: Read
tmp/data/latest-items.json(create if not exists) - Process Feeds: For each feed configuration:
- Fetch latest article from RSS/Atom feed
- Compare with stored
latestLinkin configuration - Check for duplicates in existing items
- If new article found: update config and add to items
- Save Results: Update configuration files and save new items
- Date-based Article Detection: Finds the latest article by publication date, not just the first item
- Configuration Auto-update: Prevents duplicate collection by updating
latestLinkin config files - Error Resilience: Continues processing other feeds even if some fail
- Comprehensive Logging: Detailed logs for debugging and monitoring
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run tests and ensure they pass
- Submit a pull request
This project is licensed under the MIT License.