Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

Adding params to VerifyCredentials to allow gettign emails from users if possible - #376

Merged
jeremylow merged 4 commits into
bear:masterfrom
jquacinella:master
Aug 5, 2016
Merged

Adding params to VerifyCredentials to allow gettign emails from users if possible#376
jeremylow merged 4 commits into
bear:masterfrom
jquacinella:master

Conversation

@jquacinella

@jquacinella jquacinella commented Jul 31, 2016

Copy link
Copy Markdown

This is in reference to: #235


This change is Reviewable

James Quacinella added 3 commits August 12, 2015 14:30
…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
@codecov-io

codecov-io commented Jul 31, 2016

Copy link
Copy Markdown

Current coverage is 69.11% (diff: 66.66%)

Merging #376 into master will decrease coverage by 0.04%

@@             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          

Powered by Codecov. Last update 2f222c7...714cfe0

Comment thread twitter/api.py Outdated
# 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)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to decode the resp for python3. should be

data = self._ParseAndCheckTwitter(resp.content.decode('utf-8'))

@jeremylow

Copy link
Copy Markdown
Collaborator

Looks good to me. Do you know what happens when the app isn't white listed and email is requested?

@jquacinella

Copy link
Copy Markdown
Author

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.

@jeremylow

Copy link
Copy Markdown
Collaborator

I don't have a whitelisted app, so I don't know what the actual data that comes back looks like when include_email is set to True, but when your app isn't whitelisted, there's no error thrown; the email key doesn't exist in the json response.

I think this is good to merge.

@jeremylow
jeremylow merged commit 5c41181 into bear:master Aug 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants