3
8
Fork
You've already forked frenring
1

Add support for limiting posts to be recent, fail fast parameter and fix atom feed handling #4

Open
johnnyjayjay wants to merge 11 commits from johnnyjayjay/frenring:main into main
pull from: johnnyjayjay/frenring:main
merge into: selfisekai:main
selfisekai:main
First-time contributor
Copy link

This PR does 5 things:

  • add an option day_limit (-d) that gives you the ability to limit the number of days a post can be in the past. I.e., when you do frenring ... -d 7, you only get back posts published in the last 7 days. This hard limit is not applied if the total number of resulting posts would be less than the total number requested (e.g. you ask for 3 posts, but only 2 posts from your list have been published last week). In that case, additional posts are added in reverse-chronological order to reach the total amount.
  • add an option fail_fast that enables the failure behaviour that used to be the default (fail if any of the feeds fail to be parsed). The new default behaviour is to skip feeds that fail and print a message to stderr. This mirrors the behaviour of openring more closely. If you want to preserve the previous default behaviour, I can "invert" this option though.
  • fix a bug with atom feed handling. If a link within an entry in an atom feed doesn't have a rel attribute, feed_rs sets rel="alternate". So this meant that the article construction code in parse_feed didn't pick up any post URLs from atom feeds.
  • add long names for all CLI options (don't think there's a good reason not to have those)
  • a tiny bit of refactoring + addition of a shell.nix file to help Nix(OS) users build and work with the project.
This PR does 5 things: - add an option `day_limit` (`-d`) that gives you the ability to limit the number of days a post can be in the past. I.e., when you do `frenring ... -d 7`, you only get back posts published in the last 7 days. This hard limit is not applied if the total number of resulting posts would be less than the total number requested (e.g. you ask for 3 posts, but only 2 posts from your list have been published last week). In that case, additional posts are added in reverse-chronological order to reach the total amount. - add an option `fail_fast` that enables the failure behaviour that used to be the default (fail if any of the feeds fail to be parsed). The new default behaviour is to skip feeds that fail and print a message to stderr. This mirrors the behaviour of openring more closely. If you want to preserve the previous default behaviour, I can "invert" this option though. - fix a bug with atom feed handling. If a link within an entry in an atom feed doesn't have a `rel` attribute, feed_rs sets `rel="alternate"`. So this meant that the article construction code in `parse_feed` didn't pick up any post URLs from atom feeds. - add long names for all CLI options (don't think there's a good reason not to have those) - a tiny bit of refactoring + addition of a shell.nix file to help Nix(OS) users build and work with the project.
fail_fast is an option to enable the behaviour that was the default
before: fail the whole program invocation if a single feed fails to be
fetched or parsed. The new default is that such cases will simply be
skipped in the feed candidates and a message informing about the failure
is sent to stderr.
This commit also adds long options for the CLI (there is no reason to
only allow the short versions).
atom feed entry links without a rel attribute get assigned rel=alternate
by feed_rs. Therefore, rel=alternate should be accepted for links to entries
johnnyjayjay changed title from (削除) Add support for limiting posts to be recent (削除ここまで) to Add support for limiting posts to be recent, fail fast parameter and fix atom feed handling 2024年06月17日 19:47:52 +02:00
Use the more usual archive github endpoint for downloading a tarball.
- mkShellNoCC -> mkShell:
 rustc needs a c compiler to link the final binary.
- Split inputs into nativeBuildInputs and buildInputs.
 This also makes pkg-config automatically work without the hack.
 Libraries to link against go into buildInputs.
- Use toplevel rustPlatform for RUST_SRC_PATH
Reviewed-on: johnnyjayjay/frenring#1 
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u main:johnnyjayjay-main
git switch johnnyjayjay-main

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff johnnyjayjay-main
git switch johnnyjayjay-main
git rebase main
git switch main
git merge --ff-only johnnyjayjay-main
git switch johnnyjayjay-main
git rebase main
git switch main
git merge --no-ff johnnyjayjay-main
git switch main
git merge --squash johnnyjayjay-main
git switch main
git merge --ff-only johnnyjayjay-main
git switch main
git merge johnnyjayjay-main
git push origin main
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
selfisekai/frenring!4
Reference in a new issue
selfisekai/frenring
No description provided.
Delete branch "johnnyjayjay/frenring:main"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?