jquery-cli2

0.2.1 • Public • Published

jquery-cli2 Build Status NPM version License: GPLv3+

Before using this, you should probably consider:

  • pup - Parsing HTML at the command line
  • Xidel - HTML/XML data extraction tool

Installation

npm install --global jquery-cli2

Usage

  • Counting items
cat file.html | jquery-cli2 --selector '#menu > ul > li > a' --count | paste -s -d+ | bc
cat file.html | jquery-cli2 --selector '#menu > ul > li > a' --count | wc -l
  • Parse file on disk
cat file.html | jquery-cli2 --text '#menu > li a'
  • cURL
# Find out when this package was last updated 
 
curl https://www.npmjs.org/package/jquery-cli2 | jquery-cli2 --text 'table.metadata td' | grep 'ago'
 
# Output: '10 minutes ago' 
  • Narrowing, using pipes
echo '<section><div><ul><li>testing</li></ul></div><section>' | jquery-cli2 --html div --no-trailing-line-break | jquery-cli2 --html ul --no-trailing-line-break

Building

make

🆓 License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Readme

Keywords

none

Package Sidebar

Install

npm i jquery-cli2

Weekly Downloads

1

Version

0.2.1

License

GPL-3.0+

Last publish

Collaborators

  • muchweb