/articles-clipper

Primary LanguageHTMLMIT LicenseMIT

Articles clipper

A small Cloudflare worker service, to save articles as Markdown or save them directly inside my Obsidian vault.

Local development

Development uses wrangler so make sure you are authenticated properly, then run

pnpm dev

Testing

Testing is using vitest you can run tests running the following command, locally it will watch and on CI it will run the tests and exit.

pnpm test
TODO

Deploying

CI

The repo already automatically deploys the app after every successful build on main using the official wrangler-action, a CLOUDFLARE_API_TOKEN variable is required for this.

Manually

If needed you can also deploy manually. But the deploy command uses wrangler so make sure you are authenticated properly, then run

pnpm deploy

wrangler will handle bundling and building for you before it deploy it.

How it works?

/

When you land on the root route you will see a bookmarklet that you can save in your browser to be able to quickly save an article. The bookmarklet should work also in mobile browsers.

/save

Save the article directly to your obsidian vault

Query params

Name Example Required Description
u ?u=https://example.com/post true The URL for the article to be saved example
t ?t[]=tag&t[]=tag2 false Extra tags to add to markdown frontmatter
raw ?raw=1 false Returns the markdown result instead of saving it inside Obsidian

Note

Currently there are some hardcoded defaults, like the folder & a default tag

  • folder: saved-articles
  • tag: saved-articles

Credits

TODO

  • Better logging
  • Better error handling

© Ahmed El Gabri