Skip to content

pystardust/shup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Shup

Simple HTML parser in shell.

  • Requires
    • POSIX shell
    • sed

Installation

To install shup you can edit the Makefile to match your local setup (shup is installed into the /usr/local/bin by default).

Afterwards enter the following command to install shup:

sudo make install

To uninstall shup, just run:

sudo make uninstall

Usage

USAGE: shup [OPTIONS] ["FILTER1" "FILTER2" ...]
  -h                 show this help
  -v                 show version
  -r                 raw: last filter tag will not be shown
  -t                 text: no tags will be shown
  -o   "string"      specify output indentation

FILTER FORMAT: "<tagname>"  or  "<tagname>[<search string>]"
    the search string should be present in the tag line
  EXAMPLE
    to match all div tags
         shup "div"
    to match div tags with some string
         shup "div[Qynugf]"
    will match : <div class="Qynugf">

    The string could be present anywhere inside the tags body <.>
    Patterns can be specified in the string using shell patterns
         shup "div[Qy?*[!h]f]"
 When no filters applied, shup will only format the HTML

Example

curl -s "www.gnu.org" | shup -r "body" "div[inner]" "ul" "li[[pP]hilo]" "a"

About

A POSIX shell script to parse HTML

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published