Show HN: I made a tool to clean and convert any webpage to Markdown (markdowndown.vercel.app)
My partner usually writes substack posts which I then mirror to our website’s blog section.
To automate this, I made a simple tool to scrape the post and clean it so that I can drop it to our blog easily. This might be useful to others as well.
Oh and ofcourse you can instruct GPT to make any final edits :D
106 comments
[ 3.5 ms ] story [ 189 ms ] threadWith some configuration you can get most of the way there.
Edit -
This is an excellent use of it, a free text human input capable of doing things like extracting summaries. It does not seem to be used at all for the basic task of extracting content, but for post filtering.
https://github.com/simonw/llm
In between. An alias like pdfwtf translating to "paste | llm command | copy"
And even when you see how readability parser works, AI handles most of the edge cases that content extractors fail on, so they are genuinely superseded by LLMs.
Wait, regexes are the epitome of black magic. What do you consider as black magic?
Sure, I could not write a regex engine, but the language itself can be fine if you keep it to straightfoward stuff. Unlike the famous e-mail parsing regex.
Edit: read too fast. Didn’t notice the automatic and systematic aspects.
https://github.com/deathau/markdown-clipper
I guess there are dozens of alternative extensions available out there …
https://github.com/deathau/markdownload
With extension available for Firefox, Google Chrome, Microsoft Edge and Safari.
https://omnivore.app/
1 http://www.html-tidy.org/
2 https://pandoc.org/
I am kind of tempted/horrified to run all of my final templated HTML through this and see if I can spot any lingering malformations. Depending on how structured the corrections are, could make it a test-suite thing.
Aw, tell the user which it is.
https://content-parser.com/
These are all "wrappers around readability" AFAIK (including mine), which is the Mozilla project to make sites look clean and I use often.
elinks -dump
lynx -dump
let me guess, you need more?
If there were a version of links, elinks, or lynx that executed JS that would be wonderful.
save it to disk C-s
run one of the above commands on the saved file
The challenge there is that the content is in an iframe.
If you get the URL used for the iframe you can get the content: https://url2text.com/u/kJWaZY
But that's frustrating as it requires two steps.
We might be able to help you get the content from URLs like these in one step. We have quite a bit of power in the Urlbox API that url2text isn't using.
Drop us an email: support@urlbox.com and we'll see what we can do.
https://dave.autonoma.ca/blog
Eventually, I found pandoc to be a little limiting:
* Awkward to use interpolated variables within prose.
* No real-time preview prior to rendering the final document.
* Limited options for TeX support (e.g., SVG vs. inline; ConTeXt vs. LaTeX).
* Inconsistent syntax for captions and cross-references.
* Requires glue to apply a single YAML metadata source file to multiple documents (e.g., book chapters).
* Does not (reliably) convert straight quotes to curly quotes.
For my purposes, I wanted to convert variable-laden Markdown and R Markdown to text, XHTML, and PDF formats. Eventually I replaced my tool chain of yamlp + pandoc + knitr by writing an integrated FOSS cross-platform desktop editor.
https://keenwrite.com/
KeenWrite uses flexmark-java + Renjin + KeenTeX + KeenQuotes to provide a solution that can replace pandoc + knitr in some situations.
Note how the captions and cross-reference syntax for images, tables, and equations is unified to use a double-colon sigil:
https://gitlab.com/DaveJarvis/KeenWrite/-/blob/main/docs/ref...
There's also command-line usage for integrating into build pipelines:
https://gitlab.com/DaveJarvis/KeenWrite/-/blob/main/docs/cmd...
I built a similar tool last year that doesn't have those features: https://url2text.com/
Apologies if the UI is slow - you can see some example output on the homepage.
The API it's built on is Urlbox's website screenshot API which performs far better when used directly. You can request markdown along with JS rendered HTML, metadata and screenshot all in one go: https://urlbox.com/extracting-text
You can even have it all saved directly to your S3-compatible storage: https://urlbox.com/s3
And/or delivered by webhook: https://urlbox.com/webhooks
I've been running over 1 million renders per month using Urlbox's markdown feature for a side project. It's so much better using markdown like this for embeddings and in prompts.
If you want to scrape whole websites like this you might also want to checkout this new tool by dctanner: https://usescraper.com/
Sorry it's not clearer but you can skip the screenshot in the Urlbox API if you want to with:
Here's the result of that: https://renders.urlbox.io/urlbox1/renders/5799274d37a8b4e604...Sorry the pricing isn't a good fit for you. Urlbox has been running for over 11 years. We're bootstrapped and profitable with a team of 3 (plus a few contractors). We're priced to be sustainable so our customers can depend on us in the long term. We automatically give volume discounts as your usage grows.
We were lucky to build this on a mature API that already solves loads of the edge cases around rendering different kinds of pages.
https://www.firecrawl.dev/
It also crawls (although you can scrape single pages as well)
Tried on another page of the same site, then it only gave me the last article on a 6-article page, some weird things going on.
One example --
URL: https://newsletter.pragmaticengineer.com/p/zirp-software-eng...
Sanitized output: https://substack-ai.vercel.app/u/pragmaticengineer/p/zirp-so...
Raw markdown: https://substack-ai.vercel.app/api/users/pragmaticengineer/p...
(Would be happy to open source it if anyone cares!)
I didn’t have to do anything to handle HN traffic. Just a boilerplate nextjs app.
it's literally that meme of the bus — the happy guy is you and vercel and the sad one is your wallet
(unless you need dynamic scaling and minification though)