Live data from Hacker News

Show HN: Xq – command-line XML and HTML beautifier and content extractor

github.com

31–36 of 36 posts

Re: Show HN: Xq – command-line XML and HTML beautifier and content extractor

#32

doesn't seem to work great with https://ap-playerservices.streamtheworld.com/api/livestream?station=NOVA_919&version=1.9 so xqilla and learning xlst et al still seems like my to-go for complex documents

Works fine for me, what doesn't work?

    $ curl -fsSL 'https://ap-playerservices.streamtheworld.com/api/livestream?station=NOVA_919&version=1.9' | xq -x //transport
    http
    hls
    hlsts
    http
    http
    hls
    hlsts
    http
    hls
    hlsts

Re: Show HN: Xq – command-line XML and HTML beautifier and content extractor

#33
post #28

Earlier quoted context omitted.

The pup readme looks pretty great, but a heads up that the project has had limited activity over the past few years. Several raised issues about problems compiling with latest Go releases.

Yeah, 234 forks is not a good look, but that said `brew install -s pup` with `go version go1.19.3 darwin/amd64` reports a-ok so I'd guess it just doesn't have a `go.mod` like normal go developers are used to, and that's why the brew formula moves it into the old style GOPATH setup: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/...

234 forks might be 234 contributors and PRs!

Re: Show HN: Xq – command-line XML and HTML beautifier and content extractor

#34
So there are now approximately 1 million command line tools with various overlapping feature sets for extracting data from XML, JSON, YAML, TOML, and CSV-like delimited data. Is anyone ambitious enough to have constructed a feature matrix for all of them? Is there even a complete list out there?

I wonder if this space of tools is a bit like static site generators: it's almost as easy to write your own as it is to learn somebody else's.

Re: Show HN: Xq – command-line XML and HTML beautifier and content extractor

#35

doesn't seem to work great with https://ap-playerservices.streamtheworld.com/api/livestream?station=NOVA_919&version=1.9 so xqilla and learning xlst et al still seems like my to-go for complex documents

Works fine for me, what doesn't work? $ curl -fsSL 'https://ap-playerservices.streamtheworld.com/api/livestream?station=NOVA_919&version=1.9' | xq -x //transport http hls hlsts http http hls hlsts http hls hlsts

it works if you need to not use the structured nature of the document

    for $mp in /ls:live_stream_config/ls:mountpoints/ls:mountpoint
        for $server in $mp/ls:servers/ls:server
            return { concat(
                "https://", $server/ls:ip, "/", $mp/ls:mount, ".",
                local:codec-to-ext($mp/ls:media-format/ls:audio/@codec)
            ) }
is the core of my xqilla work, its something I could replicate in jq, I don't think I could replicate it in xq however
Post reply on HN