~kris/hacks

sparser

ref: 83b1653b13073ba220e9836d46fa0054d7ee65c3 sparser/README.md -rw-r--r-- 911 bytes
83b1653b — Kris Yotam add README.md 5 months ago

#sparser

Simple URL extractor from text files. Suckless C tool.

sparser scans files for external URLs and prints them to stdout, one per line. It handles HTML, Markdown, MDX, and plain text. Optionally recurses directories and deduplicates output.

#Usage

sparser [-vuR] [path | -]

  -v    verbose (print filenames to stderr)
  -u    deduplicate URLs
  -R    recursive directory scan

  path  file or directory to scan
  -     read from stdin

#Examples

# Extract URLs from a single file
sparser notes.md

# Recursively scan a directory, deduplicate
sparser -uR ~/documents/

# Pipe from stdin
curl -s https://example.com | sparser -

#Configuration

Edit config.h to adjust file size limits, max URL length, and line buffer size.

#Requirements

A C compiler and POSIX headers.

#Installation

Edit config.mk to match your local setup, then:

make clean install