As you mentioned above, this is straight from the Twitter docs, which is fine - I'd recommend breaking it into smaller methods for better readability.