Make search operation output more verbose #40

Closed
opened 7 months ago by schrmh · 5 comments

Before opening:

  • This issue is not duplicated

Platform and software version:

  • I am running TBlock version: v2.1.0
  • My local version of the filter list repository is: v220505
  • Check the platform you are running:
    • GNU/Linux, Linux
    • Android (using Termux)
    • macOS
    • Microsoft Windows
    • *BSD
    • Other: please specify here
  • Check the installation method you used to install TBlock:
    • Python Index Package (pip)
    • AUR
    • Fedora COPR
    • Ubuntu PPA
    • Homebrew
    • Scoop
    • Windows installer (EXE file)
    • Makefile (using the latest release)
    • Makefile (using the main branch)
    • Other: please specify here

Feature description:

  1. search option to find filter list a domain is in:
    Basically an option that takes a domain as a parameter and then it spills out the filter list the domain is on.

  2. The ability to search the data that is displayed by tblock -I. Maybe via pramters that can be used together with -Q since that only seems to search in names of filter lists and often descriptions or title fields displayed by -I contain more useful info.
    E.g. let users specify which fields should be searched in and if there is a match display the filter list name or the filter list name + the matches.

**Before opening:** <!-- Please check this before opening a new issue --> - [X] This issue is not duplicated --- **Platform and software version:** - I am running TBlock version: `v2.1.0` - My local version of the filter list repository is: `v220505` - Check the platform you are running: - [ ] GNU/Linux, Linux - [ ] Android (using Termux) - [ ] macOS - [ ] Microsoft Windows - [ ] *BSD - [ ] Other: `please specify here` - Check the installation method you used to install TBlock: - [ ] Python Index Package (pip) - [X] AUR - [ ] Fedora COPR - [ ] Ubuntu PPA - [ ] Homebrew - [ ] Scoop - [ ] Windows installer (EXE file) - [ ] Makefile (using the latest release) - [ ] Makefile (using the `main` branch) - [ ] Other: `please specify here` --- **Feature description:** <!-- Please provide a clear and concise description below --> 1. search option to find filter list a domain is in: Basically an option that takes a domain as a parameter and then it spills out the filter list the domain is on. 2. The ability to search the data that is displayed by tblock -I. Maybe via pramters that can be used together with -Q since that only seems to search in names of filter lists and often descriptions or title fields displayed by -I contain more useful info. E.g. let users specify which fields should be searched in and if there is a match display the filter list name or the filter list name + the matches.
twann added this to the (deleted) milestone 7 months ago
twann self-assigned this 7 months ago
twann added this to the (deleted) project 7 months ago
Owner
  1. search option to find filter list a domain is in:
    Basically an option that takes a domain as a parameter and then it spills out the filter list the domain is on.

This feature will be implemented in #41.

  1. The ability to search the data that is displayed by tblock -I. Maybe via pramters that can be used together with -Q since that only seems to search in names of filter lists and often descriptions or title fields displayed by -I contain more useful info.
    E.g. let users specify which fields should be searched in and if there is a match display the filter list name or the filter list name + the matches.

However, this will require more work, and since I should publish a new release soon in order to fix #39, it will probably come in a future release (but don't worry, it should be soon).

> 1. search option to find filter list a domain is in: > Basically an option that takes a domain as a parameter and then it spills out the filter list the domain is on. This feature will be implemented in #41. > 2. The ability to search the data that is displayed by tblock -I. Maybe via pramters that can be used together with -Q since that only seems to search in names of filter lists and often descriptions or title fields displayed by -I contain more useful info. > E.g. let users specify which fields should be searched in and if there is a match display the filter list name or the filter list name + the matches. However, this will require more work, and since I should publish a new release soon in order to fix #39, it will probably come in a future release (but don't worry, it should be soon).
twann added this to the 2.2.0 milestone 6 months ago
twann modified the milestone from 2.2.0 to 2.3.0 6 months ago
twann modified the milestone from 2.3.0 to 3.0.0 4 months ago
Owner

Hi, I'm not sure to fully understand what you mean. Could you maybe provide a complete example?

Currently, tblock -Q searches for matches inside the following:

  • Filter list ID (such as tblock-base, easylist, adaway, etc.)
  • Title of the filter lists (such as TBlock Base filter, EasyList, AdAway default blocklist, etc.)
  • Description of the filter lists
  • Tags of the filter lists (ads, tracking, etc.)

Do you mean that it would be great to be able, for example, to search for matches only in the title field or in the description field while excluding other matches?

Currently, you can apply the same filtering options both to tblock -L and tblock -Q (see the docs for more information).

Hi, I'm not sure to fully understand what you mean. Could you maybe provide a complete example? Currently, `tblock -Q` searches for matches inside the following: - Filter list ID (such as `tblock-base`, `easylist`, `adaway`, etc.) - Title of the filter lists (such as `TBlock Base filter`, `EasyList`, `AdAway default blocklist`, etc.) - Description of the filter lists - Tags of the filter lists (`ads`, `tracking`, etc.) Do you mean that it would be great to be able, for example, to search for matches **only in the title field** or **in the description field** while excluding other matches? Currently, you can apply the same filtering options both to `tblock -L` and `tblock -Q` ([see the docs for more information](https://tblock.codeberg.page/docs/browsing-filter-lists.html)).
twann added the
Status: Needs feedback
Kind: Feature
labels 3 months ago
twann added the
Related: Ad blocker
label 3 months ago
twann changed title from [REQUEST] Add more search options to Add more search options 2 months ago
Poster

Okay, it has been a while so I will be a bit more expressive so I can re-understand it myself now:

For example tblock -Q google will only find titles of filter lists like

google-adservice-hosts
narsil-hosts-google

Then I can get more info on a filter list by e.g. tblock -I google-adservice-hosts

------------------------------------
Filter ID       : google-adservice-hosts
Title           : Google AdService and ID.Google tracking hosts
Source          : https://raw.githubusercontent.com/kowith337/PersonalFilterListCollection/master/hosts/hosts_google_adservice_id.txt
Subscribing     : yes
Syntax          : hosts
Rules           : 1
Permissions     : B
Mirrors         : 2
Custom          : no
Homepage        : https://github.com/kowith337/PersonalFilterListCollection/tree/master/hosts
License         : CC-BY-NC-4.0
Status          : may break some web pages
Tags            : ads tracking 
Description     : Google AdService and ID.Google tracking hosts
------------------------------------

So yeah, from the way I have written my request it seems like I either misunderstood something or it was added later that -Q actually searches in more fields than just the Title field.

"E.g. let users specify which fields should be searched in and if there is a match display the filter list name or the filter list name + the matches."
Regarding that, yeah maybe an exclusive option might make sense in some case? (I don't really remember what I tried to do five months ago.)
Anyways, at least a switch to let it be more verbose would be cool.
So a search with -Q together with that verbose option would then print not only the name / ID of the filter list but also the field(s) with the match.

However, technically people could always achieve the same by using multiple pipes with common tools*, it would just a bit easier if tblock provided some neat filtered display options itself.

(* E.g. for loop on everything with -I on what -Q spills out to get info about everything.
Or extending that to spilling out the Source URLs by adding grep and if people are wild they could check the Tags field beforehand by using a few more complex lines.)

Okay, it has been a while so I will be a bit more expressive so I can re-understand it myself now: For example `tblock -Q google` will only find titles of filter lists like ``` google-adservice-hosts narsil-hosts-google ``` Then I can get more info on a filter list by e.g. `tblock -I google-adservice-hosts` ``` ------------------------------------ Filter ID : google-adservice-hosts Title : Google AdService and ID.Google tracking hosts Source : https://raw.githubusercontent.com/kowith337/PersonalFilterListCollection/master/hosts/hosts_google_adservice_id.txt Subscribing : yes Syntax : hosts Rules : 1 Permissions : B Mirrors : 2 Custom : no Homepage : https://github.com/kowith337/PersonalFilterListCollection/tree/master/hosts License : CC-BY-NC-4.0 Status : may break some web pages Tags : ads tracking Description : Google AdService and ID.Google tracking hosts ------------------------------------ ``` So yeah, from the way I have written my request it seems like I either misunderstood something or it was added later that -Q actually searches in more fields than just the Title field. "E.g. let users specify which fields should be searched in and if there is a match display the filter list name or the filter list name + the matches." Regarding that, yeah maybe an exclusive option might make sense in some case? (I don't really remember what I tried to do five months ago.) Anyways, at least a switch to let it be more verbose would be cool. So a search with -Q together with that verbose option would then print not only the name / ID of the filter list but also the field(s) with the match. However, technically people could always achieve the same by using multiple pipes with common tools*, it would just a bit easier if tblock provided some neat filtered display options itself. (* E.g. for loop on everything with -I on what -Q spills out to get info about everything. Or extending that to spilling out the Source URLs by adding grep and if people are wild they could check the Tags field beforehand by using a few more complex lines.)
Owner

Oh okay I get it, you mean that the match(es) should be displayed?
A good way to go would be to do something similar to pacman:

To display information about a package:

$ pacman -Qi coreutils
Repository      : system
Name            : coreutils
Version         : 9.1-1
Description     : The basic file, shell and text manipulation utilities of the GNU operating system
Architecture    : x86_64
URL             : https://www.gnu.org/software/coreutils/
Licenses        : GPL3
Groups          : None
Provides        : None
Depends On      : glibc  acl  attr  gmp  libcap  openssl
Optional Deps   : None
Conflicts With  : None
Replaces        : None
Download Size   : 2.67 MiB
Installed Size  : 16.20 MiB
Packager        : Artix Build Bot <jenkins@artixlinux.org>
Build Date      : Sun 17 Apr 2022 10:48:46 PM CEST
Validated By    : MD5 Sum  SHA-256 Sum  Signature

To search a package:

$ pacman -Ss coreutils
system/coreutils 9.1-1 [installed]
    The basic file, shell and text manipulation utilities of the GNU operating system
community/progress 0.16-1
    Shows running coreutils basic commands and displays stats
community/uutils-coreutils 0.0.15-1
    Cross-platform Rust rewrite of the GNU coreutils

With TBlock, we could imagine something like that:

$ tblock -Q google
google-adservice-hosts: Google AdService and ID.Google tracking hosts
	Google AdService and ID.Google tracking hosts
narsil-hosts-google: Narsil/hosts Google
	Avoiding Google using Android
some-list-that-contains-google-in-its-id: [no title]
	This is a custom filter list
Oh okay I get it, you mean that the match(es) should be displayed? A good way to go would be to do something similar to `pacman`: To display information about a package: ```sh $ pacman -Qi coreutils Repository : system Name : coreutils Version : 9.1-1 Description : The basic file, shell and text manipulation utilities of the GNU operating system Architecture : x86_64 URL : https://www.gnu.org/software/coreutils/ Licenses : GPL3 Groups : None Provides : None Depends On : glibc acl attr gmp libcap openssl Optional Deps : None Conflicts With : None Replaces : None Download Size : 2.67 MiB Installed Size : 16.20 MiB Packager : Artix Build Bot <jenkins@artixlinux.org> Build Date : Sun 17 Apr 2022 10:48:46 PM CEST Validated By : MD5 Sum SHA-256 Sum Signature ``` To search a package: ```sh $ pacman -Ss coreutils system/coreutils 9.1-1 [installed] The basic file, shell and text manipulation utilities of the GNU operating system community/progress 0.16-1 Shows running coreutils basic commands and displays stats community/uutils-coreutils 0.0.15-1 Cross-platform Rust rewrite of the GNU coreutils ``` With TBlock, we could imagine something like that: ```sh $ tblock -Q google google-adservice-hosts: Google AdService and ID.Google tracking hosts Google AdService and ID.Google tracking hosts narsil-hosts-google: Narsil/hosts Google Avoiding Google using Android some-list-that-contains-google-in-its-id: [no title] This is a custom filter list ```
twann added
Status: In progress
and removed
Status: Needs feedback
labels 2 months ago
Owner

Here's what I did this evening. It is highly inspired by pacman, but I think it is more intuitive than before. I also decided to apply this new design to tblock -L as well. I think being verbose by default in that case is more user-friendly.
screenshot

However, I also added a new option (--quiet) to be less verbose, like it was previously:
screenshot

Here's what I did this evening. It is highly inspired by pacman, but I think it is more intuitive than before. I also decided to apply this new design to `tblock -L` as well. I think being verbose by default **in that case** is more user-friendly. ![screenshot](https://codeberg.org/attachments/8b86bdd1-725f-4bc6-8a3d-07ddbb21265b) However, I also added a new option (`--quiet`) to be less verbose, like it was previously: ![screenshot](https://codeberg.org/attachments/9927c60f-1961-4433-aaa7-d1e171a9e6c0)
twann added
Status: Completed
Status: Needs feedback
and removed
Status: In progress
labels 2 months ago
twann changed title from Add more search options to Make search operation output more verbose 2 months ago
twann modified the milestone from 3.0.0 to 2.5.0 2 months ago
twann closed this issue 1 month ago
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: tblock/tblock#40
Loading…
There is no content yet.