Updated script to work with the new Twitter API

The new Twitter API (v1.1) requires authentication, so the script has
been updated to do this.