Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ $# -lt 1 ]
- then
- echo """
- Usage: $0 <name>
- Example: $0 John Smith
- """
- exit 0
- fi
- name=$@
- name_dir="$(echo "$name"|sed 's/ /_/g')"
- dir="${name_dir}_mugshots"
- url="http://mugshots.com/search.html?q=$name"
- url2="$url&page="
- agent="Mozilla/5.0 (Windows NT 5.2; rv:2.0.1) Gecko/20100101 Firefox/4.0.1"
- #Get total number of page results
- let entries=$(wget "$url" --user-agent="$agent" -q -O-|\
- grep details|\
- grep result|\
- cut -d\( -f2|awk '{print $1}')
- echo "Found $entries results."
- if [ $entries -lt 1 ]
- then
- echo "No entries found!"
- exit
- fi
- let pages=$entries/10
- if [ $pages -lt 1 ]
- then
- pages=1
- fi
- mkdir "$dir"
- cd "$dir"
- for i in `seq 1 $pages`
- do
- wget "$url2" --user-agent="$agent" -q -O-|\
- grep thumbs|\
- grep jpg|\
- cut -d\" -f2|\
- sed 's/223x223/400x800/g'|\
- while read img
- do
- wget "$img"
- done
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement