Subject: | Use OAuth interface of Twitter |
Twitter requires to use the OAuth interface... The attached patch
removes the user and password params and introduces the customer_key,
customer_secret and access_token params...
- Renée
Subject: | Twitter.diff |
--- Twitter.pm 2010-11-27 23:56:59.201228482 -0800
+++ /usr/local/share/perl/5.10.0/Log/Dispatch/Twitter.pm 2010-11-28 00:06:16.822403127 -0800
@@ -24,6 +24,11 @@
$self->{username} = $args{username};
$self->{password} = $args{password};
+
+ $self->{access_token} = $args{access_token};
+ $self->{access_token_secret} = $args{access_token_secret};
+ $self->{consumer_key} = $args{consumer_key};
+ $self->{consumer_secret} = $args{consumer_secret};
}
sub log_message {
@@ -44,9 +49,12 @@
my $message = shift;
my $twitter = Net::Twitter->new(
- username => $self->{username},
- password => $self->{password},
+ consumer_key => $self->{consumer_key},
+ consumer_secret => $self->{consumer_secret},
);
+
+ $twitter->access_token( $self->{access_token} );
+ $twitter->access_token_secret( $self->{access_token_secret} );
$twitter->update($message);
}