Mojo::WebService::Twitter::Tweet - A tweet
use Mojo::WebService::Twitter; my $twitter = Mojo::WebService::Twitter->new(api_key => $api_key, api_secret => $api_secret); my $tweet = $twitter->get_tweet($tweet_id); my $username = $tweet->user->screen_name; my $created_at = $tweet->created_at; my $text = $tweet->text; say "[$created_at] \@$username: $text";
Mojo::WebService::Twitter::Tweet is an object representing a Twitter tweet. See https://dev.twitter.com/overview/api/tweets for more information.
my $href = $tweet->source;
Source data hashref from Twitter API.
my $coords = $tweet->coordinates;
Array reference of geographic coordinates (longitude then latitude), or undef if tweet does not have coordinates.
undef
my $ts = $tweet->created_at;
Time::Piece object representing the creation time of the tweet in UTC.
my $count = $tweet->favorites;
Number of times the tweet has been favorited.
my $tweet_id = $tweet->id;
Tweet identifier. Note that tweet IDs are usually too large to be represented as a number, so should always be treated as a string.
my $screen_name = $tweet->in_reply_to_screen_name;
Screen name of user whom tweet was in reply to, or undef if tweet was not a reply.
my $tweet_id = $tweet->in_reply_to_status_id;
Tweet ID which tweet was in reply to, or undef if tweet was not a reply.
my $user_id = $tweet->in_reply_to_user_id;
User ID of user whom tweet was in reply to, or undef if tweet was not a reply.
my $media = $tweet->media;
Array reference of media entities associated to this tweet as Mojo::WebService::Twitter::Media objects.
my $count = $tweet->retweets;
Number of times the tweet has been retweeted.
my $text = $tweet->text;
Text contents of tweet.
my $user = $tweet->user;
User who sent the tweet, as a Mojo::WebService::Twitter::User object.
Mojo::WebService::Twitter::Tweet inherits all methods from Mojo::Base, and implements the following new ones.
$tweet = $tweet->from_source($hr);
Populate attributes from hashref of Twitter API source data.
Report any issues on the public bugtracker.
Dan Book <dbook@cpan.org>
This software is Copyright (c) 2015 by Dan Book.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
Mojo::WebService::Twitter
To install Mojo::WebService::Twitter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojo::WebService::Twitter
CPAN shell
perl -MCPAN -e shell install Mojo::WebService::Twitter
For more information on module installation, please visit the detailed CPAN module installation guide.