add technews command, Section.Slug, FeedURL, and 6 more tests#1
Open
tamnd wants to merge 1 commit into
Open
Conversation
- cacm technews: fetches ACM TechNews at technews.acm.org/feed/ via FeedURL (absolute URL path, different base domain from the other three feeds) - Section: add Slug field matching the subcommand name (top/blogs/magazine/technews) - knownSections: expand from 3 to 4 entries with proper Name/Slug separation - cacm.go: add FeedURL(ctx, absURL, limit) so technews can use its own host; Feed now delegates to FeedURL - tests: 16 total (was 10); new cases cover FeedURL, FeedLimitZero, RSSAuthorFallback, HTMLEntities, AtomFallbackURL, AtomUpdatedFallback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the
technewssubcommand and several related improvements to the existingCACM feed implementation.
Changes
cacm technews-- fetches ACM TechNews athttps://technews.acm.org/feed/(a separate WordPress installation on a different base domain); uses the new
FeedURLmethod with an absolute URL rather than a relative pathSection.Slug-- new field matching the subcommand name (top,blogs,magazine,technews);knownSectionsexpands from 3 to 4 entries withproper
Name/SlugseparationFeedURL(ctx, absURL, limit)-- newClientmethod for feeds whose hostdiffers from
cfg.BaseURL;Feednow delegates toFeedURLFeedURL,FeedLimitZero,RSSAuthorFallback,HTMLEntities,AtomFallbackURL,AtomUpdatedFallbackTest plan
go build ./...passesgo test -race -count=1 ./...passes (16 tests, all offline)go vet ./...passescacm sectionsshows 4 rows including technews with correct URLcacm technews -n 3fetches and renders items from technews.acm.org