Usage is very simple:

# Install
sudo gem install wayback_machine_downloader

# Download latest archived version of a site
wayback_machine_downloader http://www.example.com

# Download an older version
wayback_machine_downloader -t 20050807074404 http://www.example.com

You may need to replace absolute links – e.g.:

find websites/www.example.com/ -type f -exec sed -i "s#http://www.example.com##g" '{}' +