hoarder-app / hoarder

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
https://hoarder.app
GNU Affero General Public License v3.0
6.48k stars 235 forks source link

Way to add links without extension #596

Closed fingon closed 3 weeks ago

fingon commented 3 weeks ago

Describe the feature you'd like

I would like there to be some endpoint which can be used to add links, which doesn't deal with e.g. nested json (like the current createBookmark). For example, I use currently following Google Translate bookmarklet:

javascript:var%20t=((window.getSelection&&window.getSelection())%7C%7C(document.getSelection&&document.getSelection())%7C%7C(document.selection&&document.selection.createRange&&document.selection.createRange().text));var%20e=(document.charset%7C%7Cdocument.characterSet);if(t!='')%7Blocation.href='http://translate.google.com/translate_t?text='+t+'&hl=en&langpair=auto%7Cen&tbb=1&ie='+e;%7Delse%7Blocation.href='http://translate.google.com/translate?u='+escape(location.href)+'&hl=en&langpair=auto%7Cen&tbb=1&ie='+e;%7D;

and something bit simpler (which would just stick current location.href to appropriately formatted URL in location.href as opposed to the text selection in the above fragment) would be poor mans 'add link to hoarder'.

I'm thinking of running some minimal proxy of my own in the middle, but that feels like mild overkill, and it would be better if it was something anyone can use.

Describe the benefits this would bring to existing Hoarder users

Ability to use Safari (and other even more esoteric browsers) and still gather links to Hoarder.

Can the goal of this request already be achieved via other means?

Not that I know of.

Have you searched for an existing open/closed issue?

Additional context

Safari extension support is partially covering this, but sometimes I use other niche browsers .

kamtschatka commented 3 weeks ago

there will be a rest API soon: https://docs.hoarder.app/api/create-a-new-bookmark You can simply generate the necessary JSON using JSON.stringify and make the request to the REST API. I don't think having yet another way of adding bookmarks makes any sense

fingon commented 3 weeks ago

Ah, having an API would probably address it too. Using the current not really documented API is not what I want to rely on.

kamtschatka commented 3 weeks ago

will be possible with the upcoming REST API (if you pull the latest docker, that would also be there already)