Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Documentation: Net::Twitter
My goal is to have it return the lates status & screen name of the user searched for. I'm pretty confused by hash references, as when I use the dumper I just see this=>that=>this, but I can't figure out how to access all these things that I want.
But looking at the documentation for "lookup_users", it gives an array first, maybe since you can search multiple things, I think I figured out how to access that, but after that I'm not sure.
use warnings; use 5.010; use Net::Twitter; use Config::Tiny; use Data::Dumper qw(Dumper); use File::HomeDir; use Data::Dumper; my $nt = Net::Twitter->new( ssl => 1, traits => [qw/API::RESTv1_1/], consumer_key => '', consumer_secret => '', access_token => '', access_token_secret => '', ); my $l = $nt->lookup_users({ screen_name => 'twitter'}); my $tweet = (@{$l->{screen_name}}); print "$tweet\n";
Here I just tried to grab the screen name for a start, since the "status" is deeper. But this just gives me "Not a HASH reference"
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Twitter API - Not a hash reference
by Discipulus (Canon) on Mar 08, 2018 at 20:25 UTC | |
by Anonymous Monk on Mar 08, 2018 at 20:38 UTC | |
Re: Twitter API - Not a hash reference
by stevieb (Canon) on Mar 08, 2018 at 20:24 UTC | |
by planetscape (Chancellor) on Mar 11, 2018 at 01:54 UTC | |
by Your Mother (Archbishop) on Mar 11, 2018 at 04:57 UTC | |
by karlgoethebier (Abbot) on Mar 11, 2018 at 17:45 UTC | |
by Your Mother (Archbishop) on Mar 12, 2018 at 00:28 UTC | |
|
Back to
Seekers of Perl Wisdom