@@ -18,7 +18,7 @@ my %module_build_args = (
"Marc Mims <mmims\@cpan.org>"
],
"dist_name" => "Net-Twitter",
- "dist_version" => "4.01002",
+ "dist_version" => "4.01006",
"license" => "perl",
"module_name" => "Net::Twitter",
"recommends" => {},
@@ -1,3 +1,16 @@
+4.01006 2014-11-17
+ - Default `ssl => 1`
+ - Added `mutes` (@pjcj on Github)
+
+4.01005 2014-08-12
+ - Added upload_media for multi-image support (@ghathwar)
+
+4.01004 2014-04-11
+ - PUT requires paramters in the message body, now (Samuel Kaufman)
+
+4.01003 2014-03-12
+ - Net::Twitter::Error's twitter_error_text excludes stack trace line number
+
4.01002 2014-01-16
- Fix POD bugs
@@ -22,6 +22,7 @@ lib/Net/Twitter/Role/API/Search.pm
lib/Net/Twitter/Role/API/Search/Trends.pm
lib/Net/Twitter/Role/API/TwitterVision.pm
lib/Net/Twitter/Role/API/Upload.pm
+lib/Net/Twitter/Role/API/UploadMedia.pm
lib/Net/Twitter/Role/AutoCursor.pm
lib/Net/Twitter/Role/InflateObjects.pm
lib/Net/Twitter/Role/Legacy.pm
@@ -67,4 +67,4 @@ resources:
bugtracker: http://github.com/semifor/Net-Twitter/issues
homepage: https://github.com/semifor/Net-Twitter
repository: https://github.com/semifor/Net-Twitter.git
-version: 4.01002
+version: 4.01006
@@ -2,7 +2,7 @@ NAME
Net::Twitter - A perl interface to the Twitter API
VERSION
- version 4.01002
+ version 4.01006
SYNOPSIS
use Net::Twitter;
@@ -36,36 +36,6 @@ SYNOPSIS
"Twitter error.....: ", $err->error, "\n";
}
-TWITTER NOW REQUIRES SSL
- Deprecation cycle. Twitter now requires SSL connections for API calls.
- To enable SSL, add "( ssl => 1)" to the options passed to new. E.g.,
-
- my $nt = Net::Twitter->new(
- traits => [qw/API::RESTv1_1 RetryOnError/],
- consumer_key => $key,
- consumer_secret => $secret,
- access_token => $token,
- access_token_secret => $token_secret,
- ssl => 1, ## enable SSL! ##
- );
-
- This version will warn if no "ssl" option is passed to "new". For
- backwards compatibility, the default in this version remains SSL
- disabled. A future release will change the default to SSL enabled and
- remove the warning. Add "( ssl => 0 )" to disable the warning and keep
- SSL disabled.
-
- Why not just make the default SSL enabled, now? Net::Twitter has always
- tried to adhere to a strict policy of backwards compatibility. An
- upgrade to Net::Twitter should not break or significantly change the
- behavior of existing code that relies on it. Net::Twitter is used by
- some for Twitter API compatible services that may or may not require
- SSL, and for some private test services that require non-SSL
- connections. They shouldn't break when Net::Twitter is upgraded. This
- deprecation cycle is the minimally invasive change that lets user know
- about Twitter's change without significantly changing the behavior for
- anyone upgrading.
-
TWITTER API V1.1 SUPPORT
This version of Net::Twitter provides Twitter API v1.1 support. Enable
it by including the "API::RESTv1_1" trait instead of "API::REST". Using
@@ -327,7 +297,7 @@ METHODS AND ARGUMENTS
available when the "OAuth" trait is included.
ssl If set to 1, an SSL connection will be used for all API calls.
- Defaults to 0.
+ Defaults to 1.
netrc
(Optional) Sets the *machine* key to look up in ".netrc" to
@@ -1299,6 +1269,19 @@ REST API Methods
Returns: ArrayRef[Status]
+ mutes
+ mutes(cursor)
+ alias: muting_ids
+ alias: muted_ids
+
+ Parameters: cursor
+ Required: *none*
+
+ Returns an array of numeric user ids the authenticating user has
+ muted.
+
+ Returns: ArrayRef[Int]
+
new_direct_message
new_direct_message(text)
@@ -1846,8 +1829,8 @@ REST API Methods
update
update(status)
- Parameters: status, lat, long, place_id, display_coordinates,
- in_reply_to_status_id, trim_user
+ Parameters: media_ids, status, lat, long, place_id,
+ display_coordinates, in_reply_to_status_id, trim_user
Required: status
Updates the authenticating user's status. Requires the status
@@ -2074,6 +2057,16 @@ REST API Methods
Returns: Status
+ upload
+ upload(media)
+
+ Parameters: media
+ Required: media
+
+ Upload images to twitter without posting them on the timeline
+
+ Returns: Image
+
user_suggestions
user_suggestions(category)
alias: follow_suggestions
@@ -2404,8 +2397,12 @@ CONTRIBUTORS
Allen Haim <allen@netherrealm.net>
+ Joe Papperello (@antipasta on Github and Twitter)
+
+ Samuel Kaugman (ediblenergy on Github)
+
LICENSE
- Copyright (c) 2009-2011 Marc Mims
+ Copyright (c) 2009-2014 Marc Mims
The Twitter API itself, and the description text used in this module is:
@@ -1,5 +1,5 @@
package Net::Identica;
-$Net::Identica::VERSION = '4.01002';
+$Net::Identica::VERSION = '4.01006';
use Moose;
extends 'Net::Twitter::Core';
@@ -22,7 +22,7 @@ Net::Identica - A perl interface to the Identi.ca Twitter Compatible API
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -1,5 +1,5 @@
package Net::Twitter::API;
-$Net::Twitter::API::VERSION = '4.01002';
+$Net::Twitter::API::VERSION = '4.01006';
use Moose ();
use Carp::Clan qw/^(?:Net::Twitter|Moose|Class::MOP)/;
use Moose::Exporter;
@@ -116,7 +116,7 @@ sub twitter_api_method {
}
package Net::Twitter::Meta::Method;
-$Net::Twitter::Meta::Method::VERSION = '4.01002';
+$Net::Twitter::Meta::Method::VERSION = '4.01006';
use Moose;
use Carp::Clan qw/^(?:Net::Twitter|Moose|Class::MOP)/;
extends 'Moose::Meta::Method';
@@ -162,7 +162,7 @@ Net::Twitter::API - Moose sugar for defining Twitter API methods
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -1,6 +1,6 @@
package Net::Twitter::Core;
-our $VERSION = '4.01002';
+our $VERSION = '4.01006';
# ABSTRACT: A perl interface to the Twitter API
@@ -62,22 +62,8 @@ around BUILDARGS => sub {
my %options = @_ == 1 ? %{$_[0]} : @_;
- # Twitter now requires SSL connections. Since Net::Twitter is used for
- # Twitter API compatible services that may not require, or indeed allow
- # SSL, we won't change the default, yet. We'll have a deprecation cycle
- # where we warn users if they don't have an ssl option set and let them
- # know enabling ssl will be the default in the future.
- unless ( exists $options{ssl} ) {
- warn <<'';
-The Twitter API now requires SSL. Add ( ssl => 1 ) to the options passed to new
-to enable it. For backwards compatibility, SSL is disabled by default in this
-version. Passing the ssl option to new will disable this warning. If you are
-using a Twitter API compatbile service that does not support SSL, add
-( ssl => 0 ) to disable this warning and preserve non-SSL connections in future
-upgrades.
-
- $options{ssl} = 0;
- }
+ # Default to ssl
+ $options{ssl} = 1 unless exists $options{ssl};
# aliases
for ( [ user => 'username' ], [ pass => 'password' ] ) {
@@ -182,8 +168,13 @@ sub _prepare_request {
my %natural_args = $self->_natural_args($args);
$self->_encode_args(\%natural_args);
-
- if ( $http_method =~ /^(?:GET|DELETE|PUT)$/ ) {
+ if( $http_method eq 'PUT' ) {
+ $msg = PUT(
+ $uri,
+ 'Content-Type' => 'application/x-www-form-urlencoded',
+ Content => $self->_query_string_for( \%natural_args ) );
+ }
+ elsif ( $http_method =~ /^(?:GET|DELETE)$/ ) {
$uri->query($self->_query_string_for(\%natural_args));
$msg = HTTP::Request->new($http_method, $uri);
}
@@ -364,7 +355,7 @@ Net::Twitter::Core - Net::Twitter implementation
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -1,5 +1,5 @@
package Net::Twitter::Error;
-$Net::Twitter::Error::VERSION = '4.01002';
+$Net::Twitter::Error::VERSION = '4.01006';
use Moose;
use Try::Tiny;
use Devel::StackTrace;
@@ -30,29 +30,45 @@ sub error {
# Don't walk on $@
local $@;
+ my $error = $self->has_twitter_error && $self->twitter_error_text
+ || $self->http_response->status_line;
+
+ my ($location) = $self->stack_trace->frame(0)->as_string =~ /( at .*)/;
+ return $self->_stringified($error . ($location || ''));
+}
+
+sub twitter_error_text {
+ my $self = shift;
# Twitter does not return a consistent error structure, so we have to
# try each known (or guessed) variant to find a suitable message...
- my $error = $self->has_twitter_error && do {
- my $e = $self->twitter_error;
- # the newest: array of errors
- try { exists $e->{errors} && exists $e->{errors}[0] && exists $e->{errors}[0]{message}
- && $e->{errors}[0]{message} }
+ return '' unless $self->has_twitter_error;
+ my $e = $self->twitter_error;
- # it's single error variant
- || try { exists $e->{error} && exists $e->{error}{message} && $e->{error}{message} }
+ # the newest: array of errors
+ return try {
+ exists $e->{errors}
+ && exists $e->{errors}[0]
+ && exists $e->{errors}[0]{message}
+ && $e->{errors}[0]{message};
+ }
- # or maybe it's not that deep (documentation would be helpful, here, Twitter!)
- || try { exists $e->{message} && $e->{message} }
+ # it's single error variant
+ || try {
+ exists $e->{error}
+ && exists $e->{error}{message}
+ && $e->{error}{message};
+ }
- # the original error structure
- || try { exists $e->{error} && $e->{error} }
- } || $self->http_response->status_line;
+ # or maybe it's not that deep (documentation would be helpful, here, Twitter!)
+ || try { exists $e->{message} && $e->{message} }
- my ($location) = $self->stack_trace->frame(0)->as_string =~ /( at .*)/;
- return $self->_stringified($error . ($location || ''));
+ # the original error structure
+ || try { exists $e->{error} && $e->{error} }
+ || '';
}
+
sub twitter_error_code {
my $self = shift;
@@ -78,7 +94,7 @@ Net::Twitter::Error - A Net::Twitter exception object
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -143,7 +159,12 @@ Returns true if the object contains a Twitter error HASH.
=item error
Returns the C<error> value from the C<twitter_error> HASH ref if there is one.
-Otherwise, it returns the string "[unknown]".
+Otherwise, it returns the string "[unknown]". Includes a stack trace.
+
+=item twitter_error_text
+
+Returns the C<error> value from the C<twitter_error> HASH ref if there is one.
+Otherwise, returns an empty string
=item twitter_error_code
@@ -4,7 +4,7 @@ Net::Twitter::Manual::MigratingToV1_1 - Migrating from Twitter API v1 to v1.1
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -1,5 +1,5 @@
package Net::Twitter::OAuth;
-$Net::Twitter::OAuth::VERSION = '4.01002';
+$Net::Twitter::OAuth::VERSION = '4.01006';
use Moose;
extends 'Net::Twitter::Core';
@@ -19,7 +19,7 @@ Net::Twitter::OAuth - Net::Twitter with 'Legacy' and 'OAuth' roles for backwards
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -1,5 +1,5 @@
package Net::Twitter::Role::API::Lists;
-$Net::Twitter::Role::API::Lists::VERSION = '4.01002';
+$Net::Twitter::Role::API::Lists::VERSION = '4.01006';
use Moose::Role;
use Net::Twitter::API;
use DateTime::Format::Strptime;
@@ -13,7 +13,7 @@ Net::Twitter::Role::API::Lists - Twitter Lists API support for Net::Twitter
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -1,5 +1,5 @@
package Net::Twitter::Role::API::REST;
-$Net::Twitter::Role::API::REST::VERSION = '4.01002';
+$Net::Twitter::Role::API::REST::VERSION = '4.01006';
use Moose::Role;
use Carp::Clan qw/^(?:Net::Twitter|Moose|Class::MOP)/;
use Net::Twitter::API;
@@ -1737,7 +1737,7 @@ Net::Twitter::Role::API::REST - A definition of the Twitter REST API as a Moose
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -1,11 +1,13 @@
package Net::Twitter::Role::API::RESTv1_1;
-$Net::Twitter::Role::API::RESTv1_1::VERSION = '4.01002';
+$Net::Twitter::Role::API::RESTv1_1::VERSION = '4.01006';
use Moose::Role;
use Carp::Clan qw/^(?:Net::Twitter|Moose|Class::MOP)/;
use Net::Twitter::API;
use DateTime::Format::Strptime;
use URI;
+with 'Net::Twitter::Role::API::UploadMedia';
+
# API v1.1 incorporates the Search and Upload APIs
excludes map "Net::Twitter::Role::$_", qw/API::Search API::Upload Net::Twitter::Role::RateLimit/;
@@ -130,52 +132,52 @@ authenticating user must be the author of the specified status.
twitter_api_method update => (
path => 'statuses/update',
method => 'POST',
- params => [qw/status lat long place_id display_coordinates in_reply_to_status_id trim_user/],
+ params => [qw/media_ids status lat long place_id display_coordinates in_reply_to_status_id trim_user/],
required => [qw/status/],
booleans => [qw/display_coordinates trim_user/],
add_source => 1,
returns => 'Status',
- description => <<'EOT',
+ description => <<EOT,
Updates the authenticating user's status. Requires the status parameter
specified. A status update with text identical to the authenticating
user's current status will be ignored.
-=over 4
+\=over 4
-=item status
+\=item status
Required. The text of your status update. URL encode as necessary. Statuses
over 140 characters will cause a 403 error to be returned from the API.
-=item in_reply_to_status_id
+\=item in_reply_to_status_id
Optional. The ID of an existing status that the update is in reply to. o Note:
This parameter will be ignored unless the author of the tweet this parameter
references is mentioned within the status text. Therefore, you must include
-@username, where username is the author of the referenced tweet, within the
+\@username, where username is the author of the referenced tweet, within the
update.
-=item lat
+\=item lat
Optional. The location's latitude that this tweet refers to. The valid ranges
for latitude is -90.0 to +90.0 (North is positive) inclusive. This parameter
will be ignored if outside that range, if it is not a number, if geo_enabled is
disabled, or if there not a corresponding long parameter with this tweet.
-=item long
+\=item long
Optional. The location's longitude that this tweet refers to. The valid ranges
for longitude is -180.0 to +180.0 (East is positive) inclusive. This parameter
will be ignored if outside that range, if it is not a number, if geo_enabled is
disabled, or if there not a corresponding lat parameter with this tweet.
-=item place_id
+\=item place_id
Optional. The place to attach to this status update. Valid place_ids can be
found by querying C<reverse_geocode>.
-=item display_coordinates
+\=item display_coordinates
Optional. By default, geo-tweets will have their coordinates exposed in the
status object (to remain backwards compatible with existing API applications).
@@ -183,7 +185,7 @@ To turn off the display of the precise latitude and longitude (but keep the
contextual location information), pass C<display_coordinates => 0> on the
status update.
-=back
+\=back
EOT
@@ -1398,7 +1400,7 @@ Returns details of a place returned from the C<reverse_geocode> method.
);
twitter_api_method reverse_geocode => (
- description => <<'EOT',
+ description => <<EOT,
Search for places (cities and neighborhoods) that can be attached to a
statuses/update. Given a latitude and a longitude, return a list of all the
valid places that can be used as a place_id when updating a status.
@@ -1410,19 +1412,19 @@ There are multiple granularities of places that can be returned --
"neighborhoods", "cities", etc. At this time, only United States data is
available through this method.
-=over 4
+\=over 4
-=item lat
+\=item lat
Required. The latitude to query about. Valid ranges are -90.0 to +90.0 (North
is positive) inclusive.
-=item long
+\=item long
Required. The longitude to query about. Valid ranges are -180.0 to +180.0
(East is positive) inclusive.
-=item accuracy
+\=item accuracy
Optional. A hint on the "region" in which to search. If a number, then this is
a radius in meters, but it can also take a string that is suffixed with ft to
@@ -1431,19 +1433,19 @@ coming from a device, in practice, this value is whatever accuracy the device
has measuring its location (whether it be coming from a GPS, WiFi
triangulation, etc.).
-=item granularity
+\=item granularity
Optional. The minimal granularity of data to return. If this is not passed
in, then C<neighborhood> is assumed. C<city> can also be passed.
-=item max_results
+\=item max_results
Optional. A hint as to the number of results to return. This does not
guarantee that the number of results returned will equal max_results, but
instead informs how many "nearby" results to return. Ideally, only pass in the
number of places you intend to display to the user here.
-=back
+\=back
EOT
@@ -2037,6 +2039,19 @@ used to retrieve each variation of the banner.
returns => 'HashRef',
);
+twitter_api_method mutes => (
+ description => <<'',
+Returns an array of numeric user ids the authenticating user has muted.
+
+ path => 'mutes/users/ids',
+ aliases => [qw/muting_ids muted_ids/],
+ method => 'GET',
+ params => [qw/cursor/],
+ required => [qw//],
+ booleans => [qw//],
+ returns => 'ArrayRef[Int]',
+);
+
# infer screen_name or user_id from positional args for backwards compatibility
# and convenience
around [qw/
@@ -2078,7 +2093,7 @@ Net::Twitter::Role::API::RESTv1_1 - A definition of the Twitter REST API v1.1 as
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -1,5 +1,5 @@
package Net::Twitter::Role::API::Search::Trends;
-$Net::Twitter::Role::API::Search::Trends::VERSION = '4.01002';
+$Net::Twitter::Role::API::Search::Trends::VERSION = '4.01006';
use Moose::Role;
after BUILD => sub {
@@ -26,7 +26,7 @@ Net::Twitter::Role::API::Search::Trends - DEPRECATED: use API::REST
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -1,5 +1,5 @@
package Net::Twitter::Role::API::Search;
-$Net::Twitter::Role::API::Search::VERSION = '4.01002';
+$Net::Twitter::Role::API::Search::VERSION = '4.01006';
use Moose::Role;
use Net::Twitter::API;
use DateTime::Format::Strptime;
@@ -50,7 +50,7 @@ Net::Twitter::Role::API::Search - A definition of the Twitter Search API as a Mo
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -1,5 +1,5 @@
package Net::Twitter::Role::API::TwitterVision;
-$Net::Twitter::Role::API::TwitterVision::VERSION = '4.01002';
+$Net::Twitter::Role::API::TwitterVision::VERSION = '4.01006';
use Moose::Role;
requires qw/credentials/;
@@ -47,7 +47,7 @@ Net::Twitter::Role::API::TwitterVision - A definition of the TwitterVision API a
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -1,5 +1,5 @@
package Net::Twitter::Role::API::Upload;
-$Net::Twitter::Role::API::Upload::VERSION = '4.01002';
+$Net::Twitter::Role::API::Upload::VERSION = '4.01006';
use Moose::Role;
use Net::Twitter::API;
use DateTime::Format::Strptime;
@@ -65,7 +65,7 @@ Net::Twitter::Role::API::Upload - A definition of the Twitter Upload API as a Mo
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -0,0 +1,49 @@
+package Net::Twitter::Role::API::UploadMedia;
+$Net::Twitter::Role::API::UploadMedia::VERSION = '4.01006';
+use Moose::Role;
+use Net::Twitter::API;
+use DateTime::Format::Strptime;
+use URI;
+
+has upload_url => isa => 'Str', is => 'ro', default => 'http://upload.twitter.com/1.1';
+
+after BUILD => sub {
+ my $self = shift;
+
+ $self->{upload_url} =~ s/^http:/https:/ if $self->ssl;
+};
+
+base_url 'upload_url';
+authenticate 1;
+
+twitter_api_method upload => (
+ path => 'media/upload',
+ method => 'POST',
+ params => [qw/media/],
+ required => [qw/media/],
+ booleans => [qw/possibly_sensitive display_coordinates/],
+ returns => 'Image',
+ description => 'Upload images to twitter without posting them on the timeline'
+);
+
+1;
+
+__END__
+
+=head1 NAME
+
+Net::Twitter::Role::API::UploadImage - A definition of the Twitter Upload API as a Moose role
+
+=head1 VERSION
+
+version 4.01006
+
+=head1 SYNOPSIS
+
+ package My::Twitter;
+ use Moose;
+ with 'Net::Twitter::API::UploadImage';
+
+=head1 DESCRIPTION
+
+This module provides definitions the Twitter Upload API methods.
@@ -1,5 +1,5 @@
package Net::Twitter::Role::AutoCursor;
-$Net::Twitter::Role::AutoCursor::VERSION = '4.01002';
+$Net::Twitter::Role::AutoCursor::VERSION = '4.01006';
use MooseX::Role::Parameterized;
parameter max_calls => isa => 'Int', default => 16;
@@ -68,7 +68,7 @@ Net::Twitter::Role::AutoCursor - Help transition to cursor based access to frien
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -1,5 +1,5 @@
package Net::Twitter::Role::InflateObjects;
-$Net::Twitter::Role::InflateObjects::VERSION = '4.01002';
+$Net::Twitter::Role::InflateObjects::VERSION = '4.01006';
use Moose::Role;
use namespace::autoclean;
use Data::Visitor::Callback;
@@ -11,7 +11,7 @@ Net::Twitter::Role::InflateObjects - Inflate Twitter API return values to Moose
=head1 VERSION
-version 4.01002
+version 4.01006
=cut
@@ -1,5 +1,5 @@
package Net::Twitter::Role::Legacy;
-$Net::Twitter::Role::Legacy::VERSION = '4.01002';
+$Net::Twitter::Role::Legacy::VERSION = '4.01006';
use Moose::Role;
use namespace::autoclean;
@@ -47,7 +47,7 @@ Net::Twitter::Role::Legacy - A Net::Twitter legacy compatibility layer as a Moos
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -1,5 +1,5 @@
package Net::Twitter::Role::OAuth;
-$Net::Twitter::Role::OAuth::VERSION = '4.01002';
+$Net::Twitter::Role::OAuth::VERSION = '4.01006';
use Moose::Role;
use HTTP::Request::Common;
use Carp::Clan qw/^(?:Net::Twitter|Moose|Class::MOP)/;
@@ -266,7 +266,7 @@ Net::Twitter::Role::OAuth - Net::Twitter role that provides OAuth instead of Bas
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -1,5 +1,5 @@
package Net::Twitter::Role::RateLimit;
-$Net::Twitter::Role::RateLimit::VERSION = '4.01002';
+$Net::Twitter::Role::RateLimit::VERSION = '4.01006';
use Moose::Role;
use namespace::autoclean;
use Try::Tiny;
@@ -11,7 +11,7 @@ Net::Twitter::Role::RateLimit - Rate limit features for Net::Twitter
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -1,5 +1,5 @@
package Net::Twitter::Role::RetryOnError;
-$Net::Twitter::Role::RetryOnError::VERSION = '4.01002';
+$Net::Twitter::Role::RetryOnError::VERSION = '4.01006';
use Moose::Role;
use namespace::autoclean;
use Time::HiRes;
@@ -12,7 +12,7 @@ Net::Twitter::Role::RetryOnError - Retry Twitter API calls on error
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -1,5 +1,5 @@
package Net::Twitter::Role::SimulateCursors;
-$Net::Twitter::Role::SimulateCursors::VERSION = '4.01002';
+$Net::Twitter::Role::SimulateCursors::VERSION = '4.01006';
use Moose::Role;
use namespace::autoclean;
@@ -41,7 +41,7 @@ Net::Twitter::Role::SimulateCursors - Make paging work like cursoring
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -1,5 +1,5 @@
package Net::Twitter::Role::WrapError;
-$Net::Twitter::Role::WrapError::VERSION = '4.01002';
+$Net::Twitter::Role::WrapError::VERSION = '4.01006';
use Moose::Role;
use Try::Tiny;
use Scalar::Util qw/blessed/;
@@ -64,7 +64,7 @@ Net::Twitter::Role::WrapError - Wraps Net::Twitter exceptions
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -1,5 +1,5 @@
package Net::Twitter::Search;
-$Net::Twitter::Search::VERSION = '4.01002';
+$Net::Twitter::Search::VERSION = '4.01006';
use Moose;
extends 'Net::Twitter::Core';
@@ -19,7 +19,7 @@ Net::Twitter::Search - A perl interface to the Twitter Search API
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -1,5 +1,5 @@
package Net::Twitter;
-$Net::Twitter::VERSION = '4.01002';
+$Net::Twitter::VERSION = '4.01006';
use Moose;
use Carp::Clan qw/^(?:Net::Twitter|Moose|Class::MOP)/;
use JSON;
@@ -157,7 +157,7 @@ Net::Twitter - A perl interface to the Twitter API
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 DESCRIPTION
@@ -6,7 +6,7 @@ Net::Twitter - A perl interface to the Twitter API
=head1 VERSION
-version 4.01002
+version 4.01006
=head1 SYNOPSIS
@@ -41,35 +41,6 @@ version 4.01002
"Twitter error.....: ", $err->error, "\n";
}
-=head1 TWITTER NOW REQUIRES SSL
-
-B<Deprecation cycle>. Twitter now requires SSL connections for API calls. To
-enable SSL, add C<( ssl =E<gt> 1)> to the options passed to new. E.g.,
-
- my $nt = Net::Twitter->new(
- traits => [qw/API::RESTv1_1 RetryOnError/],
- consumer_key => $key,
- consumer_secret => $secret,
- access_token => $token,
- access_token_secret => $token_secret,
- ssl => 1, ## enable SSL! ##
- );
-
-This version will warn if no C<ssl> option is passed to C<new>. For backwards
-compatibility, the default in this version remains SSL disabled. A future
-release will change the default to SSL enabled and remove the warning. Add
-C<( ssl =E<gt> 0 )> to disable the warning and keep SSL disabled.
-
-B<Why not just make the default SSL enabled, now?> Net::Twitter has always
-tried to adhere to a strict policy of backwards compatibility. An upgrade to
-Net::Twitter should not break or significantly change the behavior of existing
-code that relies on it. Net::Twitter is used by some for Twitter API compatible
-services that may or may not require SSL, and for some private test services
-that require non-SSL connections. They shouldn't break when Net::Twitter is
-upgraded. This deprecation cycle is the minimally invasive change that lets
-user know about Twitter's change without significantly changing the behavior
-for anyone upgrading.
-
=head1 TWITTER API V1.1 SUPPORT
This version of Net::Twitter provides Twitter API v1.1 support. Enable it by
@@ -353,7 +324,7 @@ the C<OAuth> trait is included.
=item ssl
-If set to 1, an SSL connection will be used for all API calls. Defaults to 0.
+If set to 1, an SSL connection will be used for all API calls. Defaults to 1.
=item netrc
@@ -1782,6 +1753,29 @@ authenticating user.
Returns: ArrayRef[Status]
+=item B<mutes>
+
+=item B<mutes(cursor)>
+
+
+=item alias: muting_ids
+
+=item alias: muted_ids
+
+
+=over 4
+
+=item Parameters: cursor
+
+=item Required: I<none>
+
+=back
+
+Returns an array of numeric user ids the authenticating user has muted.
+
+
+Returns: ArrayRef[Int]
+
=item B<new_direct_message>
=item B<new_direct_message(text)>
@@ -2661,7 +2655,7 @@ Returns: List
=over 4
-=item Parameters: status, lat, long, place_id, display_coordinates, in_reply_to_status_id, trim_user
+=item Parameters: media_ids, status, lat, long, place_id, display_coordinates, in_reply_to_status_id, trim_user
=item Required: status
@@ -2983,6 +2977,24 @@ will return an HTTP 403 error.
Returns: Status
+=item B<upload>
+
+=item B<upload(media)>
+
+
+
+=over 4
+
+=item Parameters: media
+
+=item Required: media
+
+=back
+
+Upload images to twitter without posting them on the timeline
+
+Returns: Image
+
=item B<user_suggestions>
=item B<user_suggestions(category)>
@@ -3437,9 +3449,13 @@ Justin Hunter <justin.d.hunter@gmail.com>
Allen Haim <allen@netherrealm.net>
+Joe Papperello (@antipasta on Github and Twitter)
+
+Samuel Kaugman (ediblenergy on Github)
+
=head1 LICENSE
-Copyright (c) 2009-2011 Marc Mims
+Copyright (c) 2009-2014 Marc Mims
The Twitter API itself, and the description text used in this module is:
@@ -1,7 +1,7 @@
#!perl
use warnings;
use strict;
-use Test::More tests => 4;
+use Test::More tests => 8;
use Net::Twitter::Error;
use HTTP::Response;
@@ -15,6 +15,7 @@ use HTTP::Response;
);
like $e, qr/Something wicked/, 'old school twitter error';
+ is $e->twitter_error_text, 'Something wicked', 'twitter_error_text for old school twitter error';
}
{
@@ -27,6 +28,7 @@ use HTTP::Response;
);
like $e, qr/Something wicked/, 'twitter error with message/code';
+ is $e->twitter_error_text, 'Something wicked', 'twitter_error_text for twitter error with message/code';
}
{
@@ -39,6 +41,7 @@ use HTTP::Response;
);
like $e, qr/Something wicked/, 'twitter array of errors';
+ is $e->twitter_error_text, 'Something wicked', 'twitter_error_text for twitter array of errors';
}
{
@@ -49,5 +52,6 @@ use HTTP::Response;
http_response => $res,
);
+ is $e->twitter_error_text, '', 'twitter_error_text is empty string';
like $e, qr/Bad Request/, 'twitter array of errors';
}