Also add entry in README for getviaphone
This commit is contained in:
Mike Small 2020-09-27 15:01:25 -04:00
commit d1ff573ea5
4 changed files with 30 additions and 4 deletions

View File

@ -1,9 +1,19 @@
frfac:
sed "1d;2i #!`./latest_perl`" frfac.in > frfac
check:
perl -wc frfac
perlcritic frfac
`./latest_perl` -wc frfac.in
perlcritic frfac.in
ksh93 -n getviaphone
install:
install: frfac
sudo install -o root -g wheel -m 0755 -d /usr/local/bin
sudo install -o root -g wheel -m 0555 frfac /usr/local/bin
sudo install -o root -g wheel -m 0555 getviaphone /usr/local/bin
clean:
rm -f frfac
uninstall:
sudo rm -f /usr/local/bin/frfac
sudo rm -f /usr/local/bin/getviaphone

1
README
View File

@ -3,3 +3,4 @@ Scripts to extract media URLs from websites
1. frfac - url of most recent Français Facile episode from RFI.
Usage: ftp $(frfac)
(or substitute another downloader for ftp.)
2. getviaphone - download a file via my phone.

View File

@ -1,4 +1,4 @@
#!/usr/pkg/bin/perl
#!/usr/bin/perl
# Print the URI of the most recent rfi francais facile episode.
# Feed this to a downloader. (This script doesn't itself download.)

15
latest_perl Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
bestv=0
for p in $(whereis perl)
do
if [ "$p" != "${p%bin/perl}" ];
then
v=$($p -V:PERL_VERSION | sed "s/[^']*'//;s/'.*\$//")
if [ $v -gt $bestv ]; then
best=$p
bestv=$($p -V:PERL_VERSION |
sed "s/[^']*'//;s/'.*\$//")
fi
fi
done
echo $best