Skip to content

Instantly share code, notes, and snippets.

@omarowns
Last active August 18, 2021 09:06
Show Gist options
  • Save omarowns/5711849 to your computer and use it in GitHub Desktop.
Save omarowns/5711849 to your computer and use it in GitHub Desktop.
Bash script to download all issues of The MagPi.
#!/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
@chrisb13
Copy link

Less fancy, but this worked for me:
wget -A pdf -m -p -E -k -K -np https://www.raspberrypi.org/magpi-issues/

@rastacalavera
Copy link

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!

@impshum
Copy link

impshum commented Apr 10, 2017

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