Show HN: Pup – A command-line HTML parser(github.com) |
Show HN: Pup – A command-line HTML parser(github.com) |
$ pup < robots.html title
For some reason I thought that it must come last. Turns out that you can place it anywhere in the command! All these are equivalent in bash: $ pup title < robots.html
$ pup < robots.html title
$ < robots.html pup titlehttp://pubs.opengroup.org/onlinepubs/009604599/utilities/xcu...
'A "simple command" is a sequence of optional variable assignments and redirections, in any sequence, optionally followed by words and redirections, terminated by a control operator.'
Why does everything nowadays have to come with its own package manager? I like the separation between my home directory and the "system packages". I don't want to have to care for and update and separately backup ~/go, ~/.npm and so on and so forth.
This looks super nice, I especially like the detailed list of examples. Sorry for the rant.
edit: There are binaries in the "dist" directory, the readme just did not mention them. Thanks!
It's way too much to ask of already overworked OS maintainers to handle all of the libraries of all of the development platforms and it's similarly too much to ask every library and application developer to maintain packages for all of the operating systems. You also can't have the One True Package Management system that works on all the different operating systems, it would just be too unwieldy to maintain. Even properly maintaining just .deb and .rpm packages is non-trivial and requires a certain amount of skill, compounding again the number of things developers need to be proficient in.
Packaging is a Really Hard Problem, and having every platform use its own packaging system is actually a huge step up from the way open source software used to be distributed, with tarballs and compilation instructions. The tarball was the package, and it was up to you to get it onto your system somehow. So have a little respect and appreciation, wouldya?
Not only that, but also different libraries can depend on "slightly" patched versions of the same library, making the kind of determinism an OS package manager needs completely impossible (or pointless, depending on who you're asking).
$ http example.org | pup h1 text{} | http httpbin.org/post
[1] http://httpie.org/ curl https://news.ycombinator.com | pup td.title a attr{href}
Well done and thx for sharing.irb -> require 'Nokogiri' and require 'open-uri' -> doc = Nokogiri::HTML(open('http://www.google.com/'))
and no need to store the HTML via wget on my machine. Am I missing something?
Example: nokogiri https://news.ycombinator.com -e 'puts $_.css("td.title a @href")'
I also agree with the author: jq is invaluable.