The little things give you away... A collection of various small helper stuff
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- #!/usr/bin/env bash
- # Usage: wpull2-children [FILENAME] URL
- # FILENAME defaults to wpull.db
- # Report all children of a URL
- if [[ "$#" -eq 2 ]]; then
- filename="$1"
- shift
- else
- filename=wpull.db
- fi
- if [[ ! -f "${filename}" ]]; then
- printf 'Error: %q does not exist or is not a regular file\n' "${filename}" >&2
- exit 1
- fi
- url="$1"
- curId="$(sqlite3 "${filename}" 'SELECT id FROM url_strings WHERE url = "'"${url}"'"')"
- if [[ -z "${curId}" ]]
- then
- printf 'Error: %q not found\n' "${url}" >&2
- exit 1
- fi
- sqlite3 "${filename}" 'SELECT queued_urls.*, url_strings.* FROM queued_urls JOIN url_strings ON queued_urls.url_string_id = url_strings.id WHERE parent_url_string_id = '"${curId}"
|