#!/bin/sh curl $1 2>&1 | grep "url =" | cut -d"'" -f2 | xargs wget --max-redirect=0 2>&1 | grep "^Location:" | sed 's/ \[following\]//'