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 |
Couldn't get it to work, got this error:
curl: (7) Failed to connect to raspberrypi.mythic-beasts.com port 80: No route to host
Seems awesome though, if it gets fixed or if I did something wrong, let me know!
I'd just do this.
wget -r -A .pdf https://www.raspberrypi.org/magpi-issues/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Less fancy, but this worked for me:
wget -A pdf -m -p -E -k -K -np https://www.raspberrypi.org/magpi-issues/