Skip to content

Commit

Permalink
Merge branch 'master' into oauth
Browse files Browse the repository at this point in the history
Conflicts:
	Changes
  • Loading branch information
semifor committed Jun 20, 2009
2 parents 760bed1 + a5b1067 commit cd7d505
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Changes
@@ -1,3 +1,5 @@
- Added init_args user/pass for compat with NT 2.12

3.01000_01 2009-06-12
- Updated OAuth support for desktop app PIN numbers (oauth_verifier)

Expand Down
1 change: 1 addition & 0 deletions Makefile.PL
Expand Up @@ -22,6 +22,7 @@ requires 'URI::Escape';
requires 'namespace::autoclean';
requires 'Net::OAuth::Simple';
requires 'LWP::UserAgent' => 2.032;
requires 'MooseX::MultiInitArg';
recommends 'JSON::XS';

no_index directory => 'src';
Expand Down
8 changes: 6 additions & 2 deletions lib/Net/Twitter/Core.pm
@@ -1,6 +1,7 @@
package Net::Twitter::Core;
use 5.008001;
use Moose;
use MooseX::MultiInitArg;
use Carp;
use JSON::Any qw/XS DWIW JSON/;
use URI::Escape;
Expand Down Expand Up @@ -28,8 +29,11 @@ sub isa {

has useragent_class => ( isa => 'Str', is => 'ro', default => 'LWP::UserAgent' );
has useragent_args => ( isa => 'HashRef', is => 'ro', default => sub { {} } );
has username => ( isa => 'Str', is => 'rw', predicate => 'has_username' );
has password => ( isa => 'Str', is => 'rw' );
has username => ( traits => [qw/MooseX::MultiInitArg::Trait/],
isa => 'Str', is => 'rw', predicate => 'has_username',
init_args => [qw/user/] );
has password => ( traits => [qw/MooseX::MultiInitArg::Trait/],
isa => 'Str', is => 'rw', init_args => [qw/pass/] );
has useragent => ( isa => 'Str', is => 'ro', default => "Net::Twitter/$VERSION (Perl)" );
has source => ( isa => 'Str', is => 'ro', default => 'twitterpm' );
has ua => ( isa => 'Object', is => 'rw' );
Expand Down
4 changes: 3 additions & 1 deletion lib/Net/Twitter/Role/API/REST.pm
@@ -1,6 +1,8 @@
package Net::Twitter::Role::API::REST;

use Moose::Role;

requires qw/credentials/;

use Net::Twitter::API;

requires qw/ua username password credentials/;
Expand Down
9 changes: 6 additions & 3 deletions lib/Net/Twitter/Role/API/TwitterVision.pm
@@ -1,5 +1,8 @@
package Net::Twitter::Role::API::TwitterVision;
use Moose::Role;

requires qw/credentials/;

use Net::Twitter::API;

has tvurl => ( isa => 'Str', is => 'ro', default => 'http://twittervision.com' );
Expand Down Expand Up @@ -50,13 +53,13 @@ Net::Twitter::Role::API::TwitterVision - A definition of the TwitterVision API a
package My::Twitter;
use Moose;
with 'Net::Twitter::API::Search';
with 'Net::Twitter::API::TwitterVision';
=head1 DESCRIPTION
B<Net::Twitter::Role::API::Search> provides definitions for all the Twitter Search API
B<Net::Twitter::Role::API::TwitterVision> provides definitions for all the TwitterVision API
methods. Applying this role to any class provides methods for all of the
Twitter Search API methods.
TwitterVision API methods.
=head1 METHODS
Expand Down
4 changes: 3 additions & 1 deletion lib/Net/Twitter/Role/OAuth.pm
@@ -1,6 +1,8 @@
package Net::Twitter::Role::OAuth;
use Moose::Role;

requires qw/ua/;

use namespace::autoclean;

use Net::Twitter::OAuth::Simple;
Expand Down Expand Up @@ -100,7 +102,7 @@ Here's how to authorize users as a desktop app mode:
use Net::Twitter;
my $nt = Net::Twitter>new(
my $nt = Net::Twitter->new(
traits => ['API::REST', 'OAuth'],
consumer_key => "YOUR-CONSUMER-KEY",
consumer_secret => "YOUR-CONSUMER-SECRET",
Expand Down
2 changes: 2 additions & 0 deletions lib/Net/Twitter/Role/WrapError.pm
@@ -1,6 +1,8 @@
package Net::Twitter::Role::WrapError;
use Moose::Role;

requires qw/_parse_result/;

use namespace::autoclean;

has _http_response => ( isa => 'HTTP::Response', is => 'rw',
Expand Down

0 comments on commit cd7d505

Please sign in to comment.