NAME

Mojo::WebService::Twitter::User - A Twitter user

SYNOPSIS

 use Mojo::WebService::Twitter;
 my $twitter = Mojo::WebService::Twitter->new(api_key => $api_key, api_secret => $api_secret);
 my $user = $twitter->get_user(user_id => $user_id);
 
 my $username = $user->screen_name;
 my $name = $user->name;
 my $created_at = $user->created_at;
 my $description = $user->description;
 say "[$created_at] \@$username ($user): $description";

DESCRIPTION

Mojo::WebService::Twitter::User is an object representing a Twitter user. See https://dev.twitter.com/overview/api/users for more information.

ATTRIBUTES

source

 my $href = $user->source;

Source data hashref from Twitter API.

created_at

 my $ts = $user->created_at;

Time::Piece object representing the creation time of the user in UTC.

description

 my $description = $user->description;

User's profile description.

followers

 my $count = $user->followers;

Number of followers of the user.

friends

 my $count = $user->friends;

Number of friends of the user.

id

 my $user_id = $user->id;

User identifier.

last_tweet

 my $tweet = $user->last_tweet;

Most recent tweet by the user (if any), as a Mojo::WebService::Twitter::Tweet object.

name

 my $name = $user->name;

User's full name.

protected

 my $bool = $user->protected;

Whether the user's tweets are protected.

screen_name

 my $screen_name = $user->screen_name;

User's twitter screen name.

statuses

 my $count = $user->statuses;

Number of tweets the user has sent.

time_zone

 my $tz = $user->time_zone;

String describing the user's time zone. This is now always undefined; see https://twittercommunity.com/t/upcoming-changes-to-the-developer-platform/104603.

url

 my $url = $user->url;

User's profile URL.

utc_offset

 my $seconds = $user->utc_offset;

User's current offset from UTC in seconds. This is now always undefined; see https://twittercommunity.com/t/upcoming-changes-to-the-developer-platform/104603.

verified

 my $bool = $user->verified;

Whether the user is a Verified Account.

METHODS

Mojo::WebService::Twitter::User inherits all methods from Mojo::Base, and implements the following new ones.

from_source

 $user = $user->from_source($hr);

Populate attributes from hashref of Twitter API source data.

BUGS

Report any issues on the public bugtracker.

AUTHOR

Dan Book <dbook@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2015 by Dan Book.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)

SEE ALSO

Mojo::WebService::Twitter