source: lab.git/Dev/twitter/nt_bot.pl @ a74d46a

trunk
Last change on this file since a74d46a was 8333ea0, checked in by mitty <mitty@…>, 14 years ago

git-svn-id: https://lab.mitty.jp/svn/lab/trunk@92 7d2118f6-f56c-43e7-95a2-4bb3031d96e7

  • Property mode set to 100755
File size: 689 bytes
Line 
1#!/usr/bin/env perl
2use strict;
3use warnings;
4use utf8;
5use Net::Twitter;
6
7use YAML::Tiny;
8my $config = (YAML::Tiny->read('config.yml'))->[0];
9
10my $consumer_key = $config->{'consumer_key'};
11my $consumer_key_secret = $config->{'consumer_secret'};
12my $access_token = $config->{'access_token'};
13my $access_token_secret = $config->{'access_token_secret'};
14
15my $nt = Net::Twitter->new(
16  traits          => ['API::REST', 'OAuth'],
17  consumer_key    => $consumer_key,
18  consumer_secret => $consumer_key_secret,
19);
20$nt->access_token($access_token);
21$nt->access_token_secret($access_token_secret);
22
23my $res = $nt->update({ status => "Perl から Twiitter を更新するテストですよー" });
Note: See TracBrowser for help on using the repository browser.