aboutsummaryrefslogtreecommitdiff
path: root/bin/hurl
blob: dcc0fd73aaf666e9ed5de02441998ee63b56fe49 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh
# Extract <a href="..."> URLs from an HTML document or documents

# Input is either stdin or the given arguments concatenated
cat -- "${@:-/dev/stdin}" | # shellcheck disable=SC2002

# Pipe through pup to get all the href links
pup -p 'a attr{href}' |

# Sort them uniquely
sort | uniq