Compare commits

...

1 Commits

Author SHA1 Message Date
lee2sman e446af746e experimental tool to pull down all URLs listed in a text file 2023-02-13 02:41:41 -05:00
1 changed files with 53 additions and 0 deletions

53
pulldown.fish Normal file
View File

@ -0,0 +1,53 @@
# usage: pulldown.fish files.csv outputdir/
set outputdir .
function usage
echo "Pulldown: Simple command line program built on bookmobile, to pull down a listing of URLs as readable articles"
echo "Requires bookmobile."
echo "Usage: ./pulldown --help | -h "
echo " ./pulldown -f | --file <URLlist.csv> [ -o | --output <output-dir> ]"
end
function check_args
argparse h/help l/list= o/output= -- $argv
or exit 1
if set -q _flag_help
usage
exit
end
if set -q _flag_l
set -g list $_flag_list
echo $list
end
if set -q _flag_o
set -g outputdir $_flag_output
echo $outputdir
end
end
function process
echo "Processing begin"
echo $list "contents: "
cat $list
set files (cat $list)
echo "files are: " $files
for i in $files
echo "🦾 Pulling down $i" \n
./bookmobile "$i" --format reader --output $outputdir
end
end
check_args $argv
process $argv