Adding params to VerifyCredentials to allow gettign emails from users if possible - #376
Conversation
…call. This includes the ability to get a users email if you have correct permissions. This also needed changes to the User class, to add a new email property.
Conflicts: twitter/api.py twitter/user.py
Current coverage is 69.11% (diff: 66.66%)@@ master #376 diff @@
==========================================
Files 8 8
Lines 2020 2027 +7
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 1397 1401 +4
- Misses 623 626 +3
Partials 0 0
|
| # TODO: not sure why but the twitter API needs string true, not a 1 | ||
| data['include_email'] = 'true' | ||
| resp = self._RequestUrl(url, 'GET', data) # No_cache | ||
| data = self._ParseAndCheckTwitter(resp.content) |
There was a problem hiding this comment.
need to decode the resp for python3. should be
data = self._ParseAndCheckTwitter(resp.content.decode('utf-8'))
|
Looks good to me. Do you know what happens when the app isn't white listed and email is requested? |
|
Good question. I put in the original comment "When set to true email will be returned in the user objects as a string. If the user does not have an email address on their account, or if the email address is un-verified, null will be returned". However, if the app is not white-listed, I am not sure. My assumption would be that it'll be null as well, but I would have to set this up as a use case and see. I would only be able to do that later this week / weekend. |
|
I don't have a whitelisted app, so I don't know what the actual data that comes back looks like when I think this is good to merge. |
This is in reference to: #235
This change is