Skip to content

Instantly share code, notes, and snippets.

@dremendes
Last active August 10, 2017 22:59
Show Gist options
  • Save dremendes/3abdc41623c21f61a4165354d616f799 to your computer and use it in GitHub Desktop.
Save dremendes/3abdc41623c21f61a4165354d616f799 to your computer and use it in GitHub Desktop.
Crawler mínimo para imagens da NASA
#!/bin/bash
#gets apod.nasa.gov html and
wget -qO- apod.nasa.gov |
#filters to <IMG SRC="image/xxxx/nnnnnnn...jpg"
grep IMG |
#cuts out whats outside quotes
cut -d '"' -f2 |
#prepends link
awk '{print "http://apod.nasa.gov/apod/" $0}' |
#downloads the resulting url to ~/Pictures
xargs wget --directory-prefix=/home/$USER/Pictures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment