Grab a page/article from web to joplin for creating new notes

Regarding this, Importing markdown file from command line, will it be possible to grab a webpage directly from Joplin by entering an URL (in the title field or in a dedicated field) ?

I think I saw that from Owncloud editor. Or even in “Pocket

Most likely that won’t be possible. The reason is that in most HTML pages there are plenty of invisible elements - they are hidden either via CSS or JavaScript -, so to get the page as intended without these invisible elements and to convert it to Markdown you essentially need to run it through a browser.

This can be done from the web clipper since it runs from a browser, but not directly from Joplin, which doesn’t run one.

So most likely it will only be possible to grab HTML content from the web clipper.

i can imagine.
thanks

One idea comes to my mind now you released the webclipper :slight_smile:

drum roll.... can't we use the code of webclipper as vector to grab the html article and add it to joplin desktop ? :)=

Also, now that you've opened a door with HTTP port to joplin-desktop, wont it be possible for us to use it to "POST" data to create note too? :smiley:
I know I exaggerate :smiley: but the possibilities are much better than before :slight_smile:

Yes the Clipper service that runs to support the extension is actually quite generic and can be used for other things. Once it’s stable I plan to document it properly, but basically you can already use it like this:

First, get the port where it is running by going in Options > Web clipper options. Usually it’s 41184, but it can be something else depending on your system.

Check that you can reach it like this:

curl http://127.0.0.1:41184/ping

To create a simple markdown note, you can do this:

curl -H 'Content-Type: application/json' --data '{"title":"my note", "body":"some markdown"}' http://127.0.0.1:41184/notes

To convert HTML to Markdown you can do as below, but keep in mind that (as mentioned above) if the HTML has hidden elements it will look messy.

curl -H 'Content-Type: application/json' --data '{"title":"my note", "bodyHtml":"some html code"}' http://127.0.0.1:41184/notes

You can even post an image in the data-url format:

curl -H 'Content-Type: application/json' --data '{"title":"my note", "imageDataUrl":"data:image/jpeg;base64,/9j/4AAQSkZJR"}' http://127.0.0.1:41184/notes
1 Like

wonderful !
finally a dreaam comes true :smiley:

As webclipper is now available, with Jong I added the possibility to use webclipper if it is started.
With browser Webclipper we can select the notebook where to store the note that will be created once grabbed.

I tried the same with:

curl -H 'Content-Type: application/json' http://127.0.0.1:41184/notes --data '{"title": "Community, Jong", "body": "Le voici de retour pour aborder", "notebook": "Projets", "author": "foxmask", "source_url": "https://foxmask.net/post/2018/05/24/joplin-community-jong/"}'

but the notebook is not taken into account, the note is created in the last created notebook, so I supposed that author and source_url ignored too?

What properties of data can we provide ? just title, body(Html) and imageDataUrl ?

@foxmask, there’s a new command to get the list of folders:

curl http://127.0.0.1:27583/folders 

From this list get the notebook “id”, and then you can specify it when creating the note using the “parent_id” property. For example:

curl -H 'Content-Type: application/json' http://127.0.0.1:41184/notes --data '{"title": "Community, Jong", "body": "Le voici de retour pour aborder", "parent_id": "fd78919d805f427491f22908c11eea6c", "author": "foxmask", "source_url": "https://foxmask.net/post/2018/05/24/joplin-community-jong/"}'

Also the “author” property is not supported at the moment, and url should be passed as just “url”.

1 Like

I see, great :=) thank you

Actually just writing this makes me realise the API is not very consistent with the backend (url/source_url, parentId/parent_id), which I’d like to avoid. So I’m going to change all this soon - the properties will basically map to whatever is in the database, etc.

Ok, i'll do nothing until a new version :sunglasses:

This is an older thread (I just joined and searched). An app I use, Yojimbo on MacOS, just converts the website to PDF and imports/displays it like that. That pretty much eliminates a lot of the other cruft -- it's not perfect, but the PDF format can be worked with.

There's an add-on for Safari on iOS that I use often in conjunction with Joplin: ToMarkdown converts HTML into MD which can then be copy/pasted into Joplin. It must be noted however that pictures and the like are converted as links and not as offline content.

Oh, that's even better. But how does it handle any graphic elements (ie: images)?

That‘s the point: It doesn‘t save them in Joplin‘s resource folder (after all it can‘t connect to Joplin). Instead it links to the server which provides the image on the internet.

That could of course lead to broken links at some time in the future. Time for a proper mobile clipper, I‘d say (such as Evernote‘s).

Correct, that's why it's good to store them locally. Hence a PDF will grab all of that. Perhaps the plugin might be enhanced to do that at some point; it would require consistent local storage points (easy enough).

1 Like