Created
March 22, 2017 18:13
-
-
Save noureddin/5af62d3d07344f9d85ff52a867cc74bf to your computer and use it in GitHub Desktop.
Download Linux Voice magazines and optimize them for screens
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Download Linux Voice magazines and optimize them for screens | |
# which makes them less than half in size | |
get_issue() { | |
temp_file=Linux-Voice-Issue-0$1_.pdf | |
final_file=Linux-Voice-Issue-0$1.pdf | |
[ -e $final_file ] && return | |
wget -qc --show-progress -O $temp_file \ | |
https://www.linuxvoice.com/issues/0$1/Linux-Voice-Issue-0$1.pdf && | |
ps2pdf -dSETTING=/ebook $temp_file $final_file && | |
rm -f $temp_file || | |
echo ERROR | |
} | |
if [ -z "$1" ]; then | |
for i in {27..01}; do | |
get_issue $i | |
done | |
else | |
get_issue $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment