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
@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