Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
lee2sman | e446af746e |
|
@ -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
|
Loading…
Reference in New Issue