Coder Social home page Coder Social logo

foo-dogsquared / pop-launcher-plugin-duckduckgo-bangs Goto Github PK

View Code? Open in Web Editor NEW
13.0 13.0 2.0 4.29 MB

A Pop launcher plugin to search multiple pages with Duckduckgo bangs.

License: GNU General Public License v3.0

Nix 3.17% Rust 94.19% Makefile 2.64%
duckduckgo-bang pop-launcher pop-launcher-plugin

pop-launcher-plugin-duckduckgo-bangs's People

Contributors

foo-dogsquared avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pop-launcher-plugin-duckduckgo-bangs's Issues

Store bangs relevance in plugin

While the bangs database from Duckduckgo has the ranking stored in the r key, it is better to assume that all databases have no rankings. UX-wise, it makes sense to make our plugin store the rankings especially if #1 is implemented where there is no relevance stored in the database.

Possible implementations:

  • Modify the bangs database to store the ranking.
    This is the last preference to implement. It can be slow and can be interrupting to the database.

  • Store in a separate file.
    Maybe in a JSON file, RON file, or even a simple plain-text file similar to ~/.bash_history.

Switch to Brave Search bangs database

Brave Search has a bangs database based from Duckduckgo. Though, it has been updated to have a cleaner scheme and additional metadata including a favicon link which could be used for Pop launcher since it can display them (see updated web plugin for an example of display favicons).

It will break existing changes so this will be set for v2 (if that ever happens). Additionally, Brave Search is in beta (as of 2022-04-24) so this issue will not be revisited for some time (probably). Even though, there's only a couple of users ;p, it's best to assume that in this planet of 10 billion people, somebody out there uses plugin AND uses a customized version of Duckduckgo bangs database (READ: ME!!!!).

These are the changes that will break the plugin that guarantee v2:

  • It has a new query placeholder (e.g., {query} instead of {{{s}}}).
  • Updated schema.

Compilation error

I got an error while running make install telling me the script was using a flag that is only supported on cargo nightly, so I ran rustup default nightly and ran make install again. This time I got this error:

pop-launcher-plugin-duckduckgo-bangs on ๎‚  master is ๐Ÿ“ฆ v0.1.0 via ๐Ÿฆ€ v1.66.0-nightly 
โฏ make install
cargo fmt -- --check && cargo clippy -- -Dwarnings
   Compiling proc-macro2 v1.0.29
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.76
   Compiling fnv v1.0.7
   Compiling ident_case v1.0.1
   Compiling strsim v0.10.0
   Compiling serde_derive v1.0.130
   Compiling futures-core v0.3.17
   Compiling serde v1.0.130
   Compiling memchr v2.4.1
    Checking cache-padded v1.1.1
   Compiling rustversion v1.0.5
   Compiling libc v0.2.102
   Compiling ryu v1.0.5
    Checking concurrent-queue v1.2.2
    Checking waker-fn v1.1.0
    Checking pin-project-lite v0.2.7
   Compiling serde_json v1.0.67
    Checking parking v2.0.0
    Checking fastrand v1.5.0
    Checking futures-io v0.3.17
    Checking event-listener v2.5.1
    Checking async-task v4.0.3
    Checking futures-lite v1.12.0
    Checking async-channel v1.6.1
   Compiling quote v1.0.9
    Checking once_cell v1.8.0
    Checking atomic-waker v1.0.0
    Checking itoa v0.4.8
    Checking urlencoding v2.1.0
   Compiling const_format_proc_macros v0.2.20
    Checking dirs-sys v0.3.6
    Checking blocking v1.0.2
    Checking dirs v4.0.0
    Checking const_format v0.2.20
   Compiling darling_core v0.13.0
   Compiling darling_macro v0.13.0
   Compiling darling v0.13.0
   Compiling serde_with_macros v1.5.0
    Checking serde_with v1.10.0
    Checking pop-launcher v1.0.1
    Checking pop-launcher-plugin-duckduckgo-bangs v0.1.0 (/home/aadil/code/pop-launcher-plugin-duckduckgo-bangs)
error: the borrowed expression implements the required traits
  --> src/config.rs:28:53
   |
28 |         if let Ok(string) = std::fs::read_to_string(&db_path) {
   |                                                     ^^^^^^^^ help: change this to: `db_path`
   |
   = note: `-D clippy::needless-borrow` implied by `-D warnings`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

error: could not compile `pop-launcher-plugin-duckduckgo-bangs` due to previous error
make: *** [Makefile:11: test] Error 101

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.