ultranerds has asked for the wisdom of the Perl Monks concerning the following question:

I've been going round and round in circles with this. All I want to do, is grab the user_id of a given user, who has logged in with Twitter! So far I have:
sub twitter_login { my $in = $_[0]; use Net::Twitter; my $nt = Net::Twitter->new( traits => [qw/API::RESTv1_1/], consumer_key => 'xxxx', consumer_secret => 'xxx', access_token => $in->{token}, access_token_secret => $in->{token_secret}, ); my $foo = $nt->get_configuration(); print Dumper($foo); }
This kinda works - it at least connects. However, I can't for the life of me, work out how I'm supposed to extract the user details based on this key.

Can anyone point me in the right direction? I'm currently using this module - but it seems more centered around posting stuff to pages, rather than grabbing back info I need:

http://search.cpan.org/~mmims/Net-Twitter-3.14002/lib/Net/Twitter.pod

UPDATE: I don't seem to be able to remove this post. Turns out the token_secret *is* the user_id (not like Facebook, where its a numeric value).

TIA

Andy

Replies are listed 'Best First'.
Re: Collect user_id from Net::Twitter, after login
by ww (Archbishop) on Jan 23, 2015 at 16:33 UTC

    Andy:
    Removing a post is a baaaaad idea. Someday, someone may profit from the info in your update.
    It is customary to consider for reaping when you want a node removed, but that's no guarantee it will be... and removing content is SEVERELY FROWNED UPON... and apt to get you downvoted for that sort of removal.

    Hope this adds to your understanding of the Monastery's norms.