-sub loadconf {
- # load configration data from yaml formatted file
- # param => scalar string of filename
- # ret => hash object of yaml data
-
- my $file = shift @_;
-
- my $yaml = YAML::Tiny->read($file);
-
- if ($!) {
- warn "$0: '$file' $!\n";
- }
-
- return $yaml->[0];
-}
-
-sub login {
- # make Net::Twitter::Lite object and login
- # param => hash object of configration
- # ret => Net::Twitter::Lite object
-
- my $conf = shift @_;
-
- my $bot = Net::Twitter::Lite->new(
- consumer_key => $conf->{consumer_key},
- consumer_secret => $conf->{consumer_secret},
- );
-
- $bot->access_token($conf->{access_token});
- $bot->access_token_secret($conf->{access_token_secret});
-
- return $bot;
-}
-