Skip to content

Commit f19914e

Browse files
Arpith Siromoneyclaude
andcommitted
feat: Add Go-based feed fetcher to replace Node.js implementation
This commit introduces feedfetcher, a Go program that replicates the feed fetching logic from the Node.js API server. This is the first step in moving feed refresh from client-side JavaScript to a background service. Key features: - Fetches RSS/Atom feeds via HTTP with conditional GET - Hashes articles using MD5 of GUID (identical to Node.js) - Scores articles using Unix timestamp (identical to Node.js) - Stores articles in Redis sorted sets - Stores article JSON in S3 - Includes comprehensive unit tests and CI pipeline Reference: https://github.com/feedreaderco/api/blob/master/src/feeds.js 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 6577695 commit f19914e

9 files changed

Lines changed: 1311 additions & 0 deletions

File tree

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: FeedFetcher Tests
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'feedfetcher/**'
7+
- '.github/workflows/feedfetcher-tests.yml'
8+
push:
9+
branches:
10+
- main
11+
paths:
12+
- 'feedfetcher/**'
13+
14+
jobs:
15+
test:
16+
name: Test
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Go
24+
uses: actions/setup-go@v4
25+
with:
26+
go-version: '1.21'
27+
28+
- name: Download dependencies
29+
working-directory: ./feedfetcher
30+
run: go mod download
31+
32+
- name: Run tests
33+
working-directory: ./feedfetcher
34+
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
35+
36+
- name: Upload coverage
37+
uses: codecov/codecov-action@v3
38+
with:
39+
file: ./feedfetcher/coverage.txt
40+
flags: feedfetcher
41+
42+
build:
43+
name: Build
44+
runs-on: ubuntu-latest
45+
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v4
49+
50+
- name: Set up Go
51+
uses: actions/setup-go@v4
52+
with:
53+
go-version: '1.21'
54+
55+
- name: Build binary
56+
working-directory: ./feedfetcher
57+
run: make build
58+
59+
- name: Verify binary
60+
working-directory: ./feedfetcher
61+
run: |
62+
./feedfetcher --help || true
63+
file feedfetcher
64+
65+
lint:
66+
name: Lint
67+
runs-on: ubuntu-latest
68+
69+
steps:
70+
- name: Checkout code
71+
uses: actions/checkout@v4
72+
73+
- name: Set up Go
74+
uses: actions/setup-go@v4
75+
with:
76+
go-version: '1.21'
77+
78+
- name: golangci-lint
79+
uses: golangci/golangci-lint-action@v3
80+
with:
81+
version: latest
82+
working-directory: ./feedfetcher

0 commit comments

Comments
 (0)