Twitterのhome画面のtimeline
Net::Twitterで、APIの仕様はよく知らなくてもいろいろできる。home画面で表示されるtimelineの情報の取得は以下のようにする。
use Net::Twitter; my $twit = Net::Twitter->new(username=>"????????", password=>"????????" ); my $timeline = $twit->following_timeline; use YAML::Syck; print Dump($timeline);
following_timelineではhashrefの配列としてtimelineが取得できるが、hashのキーのことはperldocに書いて無いので Dump して適当に調べる。
ユーザー名とメッセージを出力する。
for my $u (@$timeline) { print $u->{user}->{name}, ":", $u->{text}, "\n"; print "\n"; }