Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Filter to get first or last line #81

Closed
mhalano opened this issue May 30, 2024 · 5 comments
Closed

[FEATURE] Filter to get first or last line #81

mhalano opened this issue May 30, 2024 · 5 comments

Comments

@mhalano
Copy link

mhalano commented May 30, 2024

Is your feature request related to a problem? Please describe.
I use webchanges to query Debian packages versions that are available in the repository using re.findall and RegEx groups, but it returns plenty of lines, and sometimes I just want the first line or the last one.

Describe the solution you'd like.
An option like first_line and last_line to filter just one of these lines.

Describe alternatives you've considered.
I tried using RegEx but couldn't find a suitable parameter.

Additional context.
For example, with this query I just want the last line that show the newer version.
image

@mhalano mhalano changed the title [FEATURE] Filter to get last or first line [FEATURE] Filter to get first or last line May 30, 2024
@mborsetti
Copy link
Owner

Great idea!

@mborsetti
Copy link
Owner

For example, with this query I just want the last line that show the newer version.

You can keep the query as is and use additions_only; that will notify if a new line is added at the bottom, as it will have a new version number.

On second thought, I am not sure if that filter is really needed; is there another use case?

@mhalano
Copy link
Author

mhalano commented May 31, 2024

For example, with this query I just want the last line that show the newer version.

You can keep the query as is and use additions_only; that will notify if a new line is added at the bottom, as it will have a new version number.

On second thought, I am not sure if that filter is really needed; is there another use case?

I mean in the screenshot. So instead of appear two lines, like in the screenshot, it would just appear "0.9.5-2", the line I want to check for changes. Got it?

@mhalano
Copy link
Author

mhalano commented May 31, 2024

Like if you have a page that shows, let's say, 5 items, and when a new item appears it becomes the first, or the last, item and one item disappears because it's shows just 5 items.
In this case, it would be more useful to just get the first, or the last, item, the one that updates, even you could get all the 5 items because you could keep an eye on the item value.

@mborsetti
Copy link
Owner

Good news: it turns out you can write Regexes to do this, and apply the re.findall filter.

See new examples in the documentation for v3.24 just released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants