copied in reference implementation from:
https://github.com/thecodepath/ios_twitter