File Coverage

blib/lib/Net/Twitter/Lite/WithAPIv1_1.pm
Criterion Covered Total %
statement 13 15 86.6
branch 1 2 50.0
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 19 22 86.3


line stmt bran cond sub pod time code
1             package Net::Twitter::Lite::WithAPIv1_1;
2             $Net::Twitter::Lite::WithAPIv1_1::VERSION = '0.12006';
3 2     2   228551 use warnings;
  2         6  
  2         110  
4 2     2   14 use strict;
  2         5  
  2         250  
5 2     2   3177 use parent 'Net::Twitter::Lite';
  2         668  
  2         14  
6              
7             =head1 NAME
8              
9             Net::Twitter::Lite::WithAPIv1_1 - A perl API library for Twitter's API v1.1
10              
11             =head1 VERSION
12              
13             version 0.12006
14              
15             =cut
16              
17             sub twitter_api_def_from () { 'Net::Twitter::Lite::API::V1_1' }
18             sub _default_api_url () { 'http://api.twitter.com/1.1' }
19             sub _default_searchapiurl () { 'http://search.twitter.com' }
20             sub _default_search_trends_api_url () { 'http://api.twitter.com/1.1' }
21             sub _default_lists_api_url () { 'http://api.twitter.com/1.1' }
22              
23             sub new {
24 3     3 1 1320 my $class = shift;
25 3         12 my %options = @_;
26              
27             # Twitter now requires SSL connections. Since Net::Twitter::Lite is used
28             # for Twitter API compatible services that may not require, or indeed allow
29             # SSL, we won't change the default, yet. We'll have a deprecation cycle
30             # where we warn users if they don't have an ssl option set and let them
31             # know enabling ssl will be the default in the future.
32 3 50       17 unless ( exists $options{ssl} ) {
33 0         0 warn <<'';
34             The Twitter API now requires SSL. Add ( ssl => 1 ) to the options passed to new
35             to enable it. For backwards compatibility, SSL is disabled by default in this
36             version. Passing the ssl option to new will disable this warning. If you are
37             using a Twitter API compatbile service that does not support SSL, add
38             ( ssl => 0 ) to disable this warning and preserve non-SSL connections in future
39             upgrades.
40              
41 0         0 $options{ssl} = 0;
42             }
43              
44              
45 3         32 return $class->SUPER::new(legacy_lists_api => 0, %options);
46             }
47              
48             1;