geduldig/TwitterAPI — pull request #9 by biancini (2013-12-27 08:40:08+00:00)
Title: Added oAuth2 bearer token management

Hi,
I propose a small modification of your code to permit the TwitterAPI to work also with oAuth2 and the bearer token of Twitter.

Sorry for the high number of line modifications (it's my IDE which performs automatic code styling...).
The substantial modification are basically the following:

* added BearerAuth.py file with BearerAuth to be used in requests call to pass the proper auth HTTP header
* modified __init__ of TwitterApi to add an additional parameters that permits to specify whether to use oAuth1 or oAuth2
* added TOKEN_ENDPOINT constant to constants.py

Moreover I added a headers properties to TwitterResponse because in my code I needed to access the headers of the Twitter API response (they contain relevant information like the remaining calls in your 15 minutes quota by Twitter).

Sorry again that, to look at these modifications, you have to cope with a lot small changes in indentation and spacing due to my IDE code formatter...
I hope you may find these modification helpful.

Thanks for your job!
Regards,
Andrea