Files
Devour/internal/scraper/github.go
T
Tomas Dvorak 55885a0e8f first commit
2026-02-22 10:42:17 +01:00

32 lines
888 B
Go

package scraper
import (
"context"
)
// GitHubScraper scrapes documentation from GitHub repositories.
type GitHubScraper struct {
config *Config
}
// NewGitHubScraper creates a new GitHub scraper.
func NewGitHubScraper(config *Config) *GitHubScraper {
return &GitHubScraper{config: config}
}
// Scrape clones and parses documents from a GitHub repository.
func (s *GitHubScraper) Scrape(ctx context.Context, source *Source) ([]*Document, error) {
// TODO: Implement GitHub scraping
// 1. Clone repository (shallow)
// 2. Find markdown files in specified paths
// 3. Parse README, docs/, wiki
// 4. Extract code structure
return nil, nil
}
// DetectChanges checks if the repository has new commits.
func (s *GitHubScraper) DetectChanges(ctx context.Context, source *Source, lastHash string) (bool, string, error) {
// TODO: Check latest commit hash
return false, "", nil
}