#! /usr/bin/perl -wT use Mac::Growl ':all'; use Net::Twitter; use Date::Format; my $app = 'Growl/Twitter'; my @names = ('New Tweet'); RegisterNotifications($app, \@names, [$names[0]]); my $tweet = Net::Twitter->new( username=>'##REPLACE WITH USERNAME##', password=>'##REPLACE WITH PASSWORD##' ); my $last_id = undef; my $switch = 0; while(1) { my @tt = (); if($last_id) { @tt = $tweet->friends_timeline({count => 200, since_id => $last_id }); } else { @tt = $tweet->friends_timeline({count => 5 }); } foreach my $t (@{$tt[0]}) { if(!$switch) { $last_id = $t->{id}; $switch++; }; PostNotification($app, $names[0], $t->{user}{screen_name}, $t->{text}); printf("%s: %s\n", $t->{user}{screen_name}, $t->{text}); print "sleep 4\n"; sleep(4); } $switch = 0; print "sleep 37\n"; sleep(37); } exit;