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

Support for "real" keyword searches #311

Closed
arcticicestudio opened this issue Sep 5, 2018 · 7 comments
Closed

Support for "real" keyword searches #311

arcticicestudio opened this issue Sep 5, 2018 · 7 comments

Comments

@arcticicestudio
Copy link

First, I want to say thanks for this great project and the still ongoing development of new features 👍. I currently switch to Buku as my default CLI bookmark manager. I've also tested shiori, but it definitely lacks support for many features (still in a very early state of development) and I want to use a already stable-proven and "production-ready" app.

Firefox “Keyword Searches”

There is one bookmark feature of Firefox I don't want to miss anymore and it seems like it is really “underused” which may be due to its unfamiliarity: Keyword Searches or also know as FAQ question “How to search IMDB, Wikipedia and more from the address bar”.
I was a bit confused after playing around with buku and reading through the documentation about the usage of the word “keyword” (or “search keyword”) which should be better described with the word “search term” or “search pattern”. In the context of Firefox bookmarks it is a bit misleading due to the “keyword” feature.
In short, the “Keyword Search” Firefox feature allows to add a keyword to a bookmark.

gh-311-firefox-bookmark-keyword

This allows to quickly use the search function a specific site, which is the same as web search engines (based on the Open Search Standard, by entering the keyword followed by a whitespace and then the actual search term.

Example using the keyword ghs (GitHub Stars) to search my own GitHub stars for react:

ghs react

The URL of the bookmark would be https://github.com/arcticicestudio?tab=stars&q=%s where the %s will be replaced with the search term where special characters will escaped automatically. See the Mozilla knowledge base documentation for more details about the advantages of using a captial %S.

Note that a bookmark's keywords should not be confused with tags! These are two different features. Also note that the keyword feature is not limited to Firefox but also available for other browsers like Google Chrome and Chromium.

Current compatibility with buku

Anyway, I've tested the import & export feature of buku and noticed that the keyword of bookmark that has been created with Firefox will be lost when beeing imported in buku. So when exporting the buku database as .html file and import it into Firefox the keywords will be lost.

Using the Firefox function “Export Bookmarks to HTML…” from within the bookmark manager window will create a file content like this when only one bookmark has been created that includes a keyword assignment (same example like above):

<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
     It will be read and overwritten.
     DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks Menu</H1>

<DL><p>
    <DT><A HREF="https://github.com/arcticicestudio?tab=repositories&q=%s" ADD_DATE="1536134961" LAST_MODIFIED="1536134973" SHORTCUTURL="ghs">GitHub Stars</A>
</DL>

Note the SHORTCUTURL property on the <A> tag stores the defined keyword of the bookmark. Importing this file into buku via buku --import path/to/bookmark.html will now result in a data loss in form of all keywords.

Feature request

What I'd like to request for buku is a new feature that allows to

  • Add a keyword to a bookmark via the CLI e.g. with -k/--keyword followed by one keyword.
    • buku need to check if there are more than one and if yes deny the creation
    • buku must validate that the keyword contains no whitespaces and special characters
    • Optional: A nice to have would be to check if the keyword is unique, means it has not been used for another bookmark. As far as I know Firefox doesn't check for it so it would be a nice addition to ensure all keywords are unique.
  • Add support for keywords when exporting the buku database so these can be easily used again in Firefox
  • Add support for already defined keywords (SHORTCUTURL prop) when importing bookmarks

Unfortunately my free time is limited, otherwise I'd like to get deeper into code of the buku and submit a PR. If there are any questions regarding this request feel free to ask 😄

@jarun
Copy link
Owner

jarun commented Sep 5, 2018

Thanks for the suggestion. My understanding from your explanation is the keyword is the shortcut to a url e.g. a search URL. So when you fire the keyword with a search pattern the pattern is appended to the URL.

To me it seems more relevant to a web search utility than a bookmarking one because not all URLs would be search URIs. Yes, it's also relevant to a browser where you can use it to fire a query in the address bar directly.

Unfortunately my free time is limited

That goes for us too. We are only two devs working on this now. The work involved in adding a new field, making the upgrade seamless, modifying our import and export APIs etc. sounds overwhelming at this stage of the project. The best I can do is add this in the ToDo list.

“search term” or “search pattern”

I would prefer the word search term. Would you care to raise a PR for this?

@arcticicestudio
Copy link
Author

I would prefer the word search term. Would you care to raise a PR for this?

I'll see if there is some time on weekends to do it. If anyone else would like to grab this task: Feel free to do it 😄
Adding the predefined „good first issue“, „help wanted“ and next month starting „Hacktoberfest“ issue labels might draw attention to it.

@jarun
Copy link
Owner

jarun commented Sep 16, 2018

I have added an item in the todo list for keyword. I will wait for a PR from you on the search term change.

@jarun jarun closed this as completed Sep 16, 2018
@jarun jarun mentioned this issue Sep 16, 2018
61 tasks
@jarun jarun reopened this Dec 15, 2018
@jarun jarun mentioned this issue Dec 29, 2018
66 tasks
@cezhunter
Copy link

I did a similar project for school (tagging web pages for bookmark organization/categorization) and I discovered that Aylien and Google provide services that work wonders (topic modeling and keyword extraction) for something like this.

@jarun
Copy link
Owner

jarun commented Jan 7, 2019

It would be great if you can contribute this feature.

@jarun
Copy link
Owner

jarun commented Apr 24, 2019

This is already in the ToDo list. Closing the defect.

@jarun jarun closed this as completed Apr 24, 2019
@Boot-Error
Copy link

I did a similar project for school (tagging web pages for bookmark organization/categorization) and I discovered that Aylien and Google provide services that work wonders (topic modeling and keyword extraction) for something like this.

Was this implemented? This seems different from the OP's suggestion. Can you please clarify the issue?

@github-actions github-actions bot locked and limited conversation to collaborators Jun 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants