Show HN: txtify.it – Easily convert web articles to plain text
txtify.it
txtify.it
Suggestion: allow larger line widths to be specified (for fewer, longer lines in large paragraphs).
https://txtify.it/www.economist.com/news/finance-and-economi...
It also shows up in your example as well. Maybe you don't get bothered by it? :)
Please note: the bug is inconsistent, it pops out inconsistently.
Here's the part: "GET OUR DAILY NEWSLETTER Upgrade your inbox and get our Daily Dispatch and Editor's Picks."
Should be fixed now. We now strip that out: https://github.com/fivefilters/ftr-site-config/blob/master/e...
But I don't consider that a big problem - lots of sites include things like that in their content. It's annoying, but no easy way to identify them all accurately and remove them without custom rules.
liked the project by the way!
The article detection, extraction and conversion happens with our Full-Text RSS product which we sell (see link for demo in another comment). So the code here is mostly sending a HTTP request to that and asking for plain text output. The HTML to text conversion in Full-Text RSS uses the Html2Text library found here https://github.com/mtibben/html2text
w3m -dump <url>
which dumps the website’s text content to stdout.But, I realised it's possible to send a stylesheet in the HTTP header. Chrome seems to ignore it, but Firefox uses it:
Link: <https://txtify.it/dark.css>; rel="stylesheet" @viewport {
width: device-width, initial-scale=1;
}
But didn't work in mobile Firefox.Seems Firefox and Chrome on mobile handle plain text differently. Firefox shows the text quite small (smaller than if it tried to fit it to device width). Chrome on Android, on the other hand, doesn't seem to try to fit the content at all, showing it at fixed scale which causes additional wrapping to the already 70-char wrapped text we output.
Happy to experiment more with CSS, but ultimately this is simply supposed to be plain text output, so optimal readability isn't really the goal here - although would be nice to improve it. :)