Updated code following Twitter API change

When Twitter changed their API a couple of years ago it broke the script
- I've only just got around to committing my fix.