Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coderobe/hq
A HTML processor inspired by jq
https://github.com/coderobe/hq
css-selector html parser processor
Last synced: 14 days ago
JSON representation
A HTML processor inspired by jq
- Host: GitHub
- URL: https://github.com/coderobe/hq
- Owner: coderobe
- License: agpl-3.0
- Created: 2018-09-29T13:06:31.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-29T10:18:16.000Z (over 1 year ago)
- Last Synced: 2024-10-14T23:25:01.855Z (27 days ago)
- Topics: css-selector, html, parser, processor
- Language: C++
- Homepage:
- Size: 25.4 KB
- Stars: 108
- Watchers: 4
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-tools - coderobe/hq - A HTML processor inspired by jq (Command Line / Like jq)
README
# hq
A HTML processor inspired by jq (https://github.com/stedolan/jq)
## Building & Usage
### Building
#### Dependencies
- meson
- modest (https://github.com/lexborisov/Modest)#### Build
`meson build && ninja -C build`The executable will be built to `build/hq`.
### Usage
#### Dependencies
- modest (https://github.com/lexborisov/Modest)#### Use
Application help text:
```
hq (html query) - commandline HTML processor © Mara Robin Broda, 2018
Usage: build/hq [options] [mode argument]Options:
-h, --help
show this text
-f, --file
file to read (defaults to stdin)
-d, --delimiter
delimiter character to use between results (defaults to newline)
-0, --null
uses \0 as delimiter
CSS selector to match against
processing mode
may be one of { data, text, attr }:
data - return raw html of matching elements
text - return inner text of matching elements
[mode argument: formatting]
supported modes: { plain, ansi, md }
default: plain
for plain, ANSI, or markdown formatted output respectively
attr - return attribute value of matching elements
attribute to returnExamples:
curl -sSL https://example.com | build/hq a data
curl -sSL https://example.com | build/hq a attr href
```Example usage:
`curl -s https://coderobe.net | hq a data`
```
Keybase (coderobe)
Github (coderobe)
Twitter (coderobe)
````curl -s https://coderobe.net | hq a text`
```
Keybase (coderobe)
Github (coderobe)
Twitter (coderobe)
````curl -s https://coderobe.net | hq a attr href`
```
https://keybase.io/coderobe
https://github.com/coderobe
https://twitter.com/coderobe
```You get the idea.
## License
This work, written by Mara Robin Broda (coderobe) in 2018, is licensed under the terms of the GNU Affero General Public License v3.0