Closed Karldevine closed 7 years ago
Something's fishy, here. It doesn't work as advertised for me. Seems like a huge privacy violation if Twitter is actually sharing email addresses with 3rd party apps. I've requested some clarification from the Twitter API team.
In the meantime, you can use this (or any other new or undocumented option). Net::Twitter passes all provided options through to Twitter. So, this should work.
my $r = $nt->verify_credentials({ include_email => 1 })
The code does not return an email unless i've made the changes above. Looks like the param isn't passed. The email setting has to be applied for with twitter - it is listed on the permissions approval screen to the user
Yeah. Just discovered this is a case of RTFM. The option is definitely getting passed. I've verified that. Perhaps Twitter is being pedantic about the value. Give this a try:
$r = $nt->verify_credentials({ include_email => 'true' });
Twitter usually accepts 'true', 't', or 1 for boolean options. Perhaps not with this option. Adding the option to booleans
as you've done above results in Net::Twitter translating perl truthy values to 'true' and falsey values to 'false'.
ref: https://dev.twitter.com/rest/reference/get/account/verify_credentials there is an include_email flag that can be set for verify_credentials now.
just needs adding to RESTv1_1.pm
twitter_api_method verify_credentials => ( description => <<'', Returns an HTTP 200 OK response code and a representation of the requesting user if authentication was successful; returns a 401 status code and an error message if not. Use this method to test if supplied user credentials are valid.
);