go-shiori / go-readability

Go package that cleans a HTML page for better readability.
MIT License
729 stars 88 forks source link

release it as cli tool binary on github #10

Closed m040601 closed 5 years ago

m040601 commented 5 years ago

Any chance you could actualy provide a very simple cli tool, based on this same go-readability package, and release it as a binary on github ?

I'm talking something very simple here. I know that something like shiori already exists.

Something like this. Give it a url or html file (or read html from standard input). Just output the cleaned up html (with/without pictures?) to a html file. Or just dump plain text to standard output. The text could also be a markdow rendition of the html page (https://github.com/lunny/html2md). Or it could also be ansi escaped for ( bold color ?), ready to be piped to 'less' etc..

This would make a great little portable, easy to install cli tool to combine as a filter/pipe to other tools. Extremely useful in the Linux world. Examples:

Why ?

Releasing a small cli binary, just makes your tool available for someone who just wants to check it out quickly. Not everyone has the entire go distribution installed or as a simple user is familiar with compiling.Besides that releasing a binary, would make it easier for others to create a package for a Linux distro, based on the binary (ex. Archlinux AUR).i

Other examples. These guys have made something similar,:

  1. The original, https://github.com/desmondhume/newspaper , uses the Mercury API This fork, https://github.com/feeeper/newspaper/blob/readability-support/main.go uses html2md and go-readability, but doesnt seem maintained/updated anymore.

  2. This other, https://github.com/philipjkim/goreadability may do so in the future, but it's not based on the Mozilla/Readability algorithm. It's a port of arc90's readability project to Go

Additional. https://github.com/goreleaser/goreleaser https://help.github.com/en/articles/creating-releases travis, https://blog.questionable.services/article/build-go-binaries-travis-ci-github/ circleci, https://circleci.com/blog/publishing-to-github-releases-via-circleci/

RadhiFadlillah commented 5 years ago

Yep, it sounds easy enough to do. I will try to do it later this weekend.

RadhiFadlillah commented 5 years ago

@m040601 I've created a simple CLI app in a32ac5.

First you need to install it :

go get -u -v github.com/go-shiori/go-readability/cmd/...

Then you can use it in your terminal like this :

go-readability https://arstechnica.com/science/2019/03/us-computer-science-grads-outperforming-those-in-other-key-nations/ > ars.html

For more info, check the readme.

RadhiFadlillah commented 5 years ago

Since it has been added, I will close this issue for now.

m040601 commented 3 years ago

Any chance of provinding this precompiled binary, now that github has actions/workflows ?

Example: gotop/.github/workflows at master · xxxserxxx/gotop

How to 🚀 GitHub Action for release your Go projects as fast and easily as possible - DEV Community