Skip to content

Commit

Permalink
fix %opt build
Browse files Browse the repository at this point in the history
  • Loading branch information
withgod committed Jan 19, 2011
1 parent f1674a2 commit 268ad49
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/Plagger/Plugin/Publish/Twitter.pm
Expand Up @@ -18,18 +18,19 @@ sub register {
sub initialize {
my($self, $context) = @_;
my %opt = (
traits => ['API::REST', 'OAuth'],
username => $self->conf->{username},
password => $self->conf->{password},
traits => ['API::REST', 'OAuth'],
);
if ($self->conf->{access_token} and $self->conf->{access_token_secret}) {
$opt{access_token} = $self->conf->{access_token};
$opt{access_token_secret} = $self->conf->{access_token_secret};
} else {
$opt{username} = $self->conf->{username};
$opt{passowrd} = $self->conf->{password};
}
for my $key (qw/apihost apiurl apirealm consumer_key consumer_secret/) {
$opt{$key} = $self->conf->{$key} if $self->conf->{$key};
}
my $nettwitter = Net::Twitter->new(%opt);
if ($self->conf->{access_token} and $self->conf->{access_token_secret}) {
$nettwitter->access_token($self->conf->{access_token});
$nettwitter->access_token_secret($self->conf->{access_token_secret});
}
$self->{twitter} = $nettwitter;
}

Expand Down

0 comments on commit 268ad49

Please sign in to comment.