Last active
August 18, 2021 09:06
-
-
Save omarowns/5711849 to your computer and use it in GitHub Desktop.
Bash script to download all issues of The MagPi.
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 | |
MAGPPI_URL="https://www.raspberrypi.org/magpi-issues/" | |
function get_issues() { | |
curl $MAGPI_URL | grep "\"MagPi\d\d\.pdf\"" | grep -o "MagPi\d\d.pdf" | uniq > /tmp/magpi_issues.list | |
} | |
function download() { | |
cat issues.list | xargs printf "https://www.raspberrypi.org/magpi-issues/%s\n" $1 | xargs wget | |
} | |
get_issues | |
download |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'd just do this.
wget -r -A .pdf https://www.raspberrypi.org/magpi-issues/