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

VerifyCredentials: sending parameters as string instead of boolean, s…#434

Closed
aabreu wants to merge 1 commit intobear:masterfrom
aabreu:master
Closed

VerifyCredentials: sending parameters as string instead of boolean, s…#434
aabreu wants to merge 1 commit intobear:masterfrom
aabreu:master

Conversation

@aabreu
Copy link
Copy Markdown

@aabreu aabreu commented Feb 8, 2017

…eems like Twitter expects a string and do not react to a boolean


This change is Reviewable

…eems like Twitter expects a string and do not react to a boolean
@jeremylow
Copy link
Copy Markdown
Collaborator

I'm not seeing this behavior.

In [10]: a = api.VerifyCredentials(include_entities=True)

In [11]: b = api.VerifyCredentials(include_entities=False)

In [14]: a.AsDict()
Out[14]: 
{u'created_at': u'Wed Oct 21 23:53:04 +0000 2015',
 u'default_profile_image': True,
 u'favourites_count': 7,
 u'followers_count': 2,
 u'friends_count': 2,
 u'geo_enabled': True,
 u'id': 4012966701,
 u'lang': u'en',
 u'listed_count': 1,
 u'name': u'notinourselves',
 u'profile_background_color': u'000000',
 u'profile_background_image_url': u'http://pbs.twimg.com/profile_background_images/736320724164448256/LgaAQoav.jpg',
 u'profile_banner_url': u'https://pbs.twimg.com/profile_banners/4012966701/1453123196',
 u'profile_image_url': u'http://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png',
 u'profile_link_color': u'981CEB',
 u'profile_sidebar_fill_color': u'000000',
 u'profile_text_color': u'000000',
 u'protected': True,
 u'screen_name': u'notinourselves',
 u'status': {u'created_at': u'Thu Dec 29 10:22:36 +0000 2016',
  u'hashtags': [],
  u'id': 814416321119195136,
  u'id_str': u'814416321119195136',
  u'lang': u'en',
  u'source': u'<a href="proxy.php?url=http%3A%2F%2Ftwitter.com" rel="nofollow">Twitter Web Client</a>',
  u'text': u'test stream @__jcbl__',
  u'urls': [],
  u'user_mentions': [{u'id': 372018022,
    u'name': u'Jeremy',
    u'screen_name': u'__jcbl__'}]},
 u'statuses_count': 90}

In [15]: b.AsDict()
Out[15]: 
{u'created_at': u'Wed Oct 21 23:53:04 +0000 2015',
 u'default_profile_image': True,
 u'favourites_count': 7,
 u'followers_count': 2,
 u'friends_count': 2,
 u'geo_enabled': True,
 u'id': 4012966701,
 u'lang': u'en',
 u'listed_count': 1,
 u'name': u'notinourselves',
 u'profile_background_color': u'000000',
 u'profile_background_image_url': u'http://pbs.twimg.com/profile_background_images/736320724164448256/LgaAQoav.jpg',
 u'profile_banner_url': u'https://pbs.twimg.com/profile_banners/4012966701/1453123196',
 u'profile_image_url': u'http://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png',
 u'profile_link_color': u'981CEB',
 u'profile_sidebar_fill_color': u'000000',
 u'profile_text_color': u'000000',
 u'protected': True,
 u'screen_name': u'notinourselves',
 u'status': {u'created_at': u'Thu Dec 29 10:22:36 +0000 2016',
  u'id': 814416321119195136,
  u'id_str': u'814416321119195136',
  u'lang': u'en',
  u'source': u'<a href="proxy.php?url=http%3A%2F%2Ftwitter.com" rel="nofollow">Twitter Web Client</a>',
  u'text': u'test stream @__jcbl__'},
 u'statuses_count': 90}

In [16]: c = api.VerifyCredentials(skip_status=True)

In [17]: d = api.VerifyCredentials(skip_status=False)

In [19]: c.AsDict()
Out[19]: 
{u'created_at': u'Wed Oct 21 23:53:04 +0000 2015',
 u'default_profile_image': True,
 u'favourites_count': 7,
 u'followers_count': 2,
 u'friends_count': 2,
 u'geo_enabled': True,
 u'id': 4012966701,
 u'lang': u'en',
 u'listed_count': 1,
 u'name': u'notinourselves',
 u'profile_background_color': u'000000',
 u'profile_background_image_url': u'http://pbs.twimg.com/profile_background_images/736320724164448256/LgaAQoav.jpg',
 u'profile_banner_url': u'https://pbs.twimg.com/profile_banners/4012966701/1453123196',
 u'profile_image_url': u'http://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png',
 u'profile_link_color': u'981CEB',
 u'profile_sidebar_fill_color': u'000000',
 u'profile_text_color': u'000000',
 u'protected': True,
 u'screen_name': u'notinourselves',
 u'statuses_count': 90}

In [20]: d.AsDict()
Out[20]: 
{u'created_at': u'Wed Oct 21 23:53:04 +0000 2015',
 u'default_profile_image': True,
 u'favourites_count': 7,
 u'followers_count': 2,
 u'friends_count': 2,
 u'geo_enabled': True,
 u'id': 4012966701,
 u'lang': u'en',
 u'listed_count': 1,
 u'name': u'notinourselves',
 u'profile_background_color': u'000000',
 u'profile_background_image_url': u'http://pbs.twimg.com/profile_background_images/736320724164448256/LgaAQoav.jpg',
 u'profile_banner_url': u'https://pbs.twimg.com/profile_banners/4012966701/1453123196',
 u'profile_image_url': u'http://abs.twimg.com/sticky/default_profile_images/default_profile_2_normal.png',
 u'profile_link_color': u'981CEB',
 u'profile_sidebar_fill_color': u'000000',
 u'profile_text_color': u'000000',
 u'protected': True,
 u'screen_name': u'notinourselves',
 u'status': {u'created_at': u'Thu Dec 29 10:22:36 +0000 2016',
  u'id': 814416321119195136,
  u'id_str': u'814416321119195136',
  u'lang': u'en',
  u'source': u'<a href="proxy.php?url=http%3A%2F%2Ftwitter.com" rel="nofollow">Twitter Web Client</a>',
  u'text': u'test stream @__jcbl__'},
 u'statuses_count': 90}

As far as I know, the include_email parameter requires an app to be whitelisted, so if you're testing on an app that isn't, then you're right: that parameter won't do anything because it fails silently. See #235 for discussion.

w/r/t the include_entities parameter, you're not going to get back an actual entities or extended_entities node, since we populate the Status object a little differently than you might think. See #387 for a discussion about that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants