Created
August 1, 2009 07:13
-
-
Save yusukebe/159595 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use strict; | |
| use warnings; | |
| use List::Util qw( shuffle ); | |
| use Net::Twitter; | |
| use utf8; | |
| my @nanpa_text = qw/ | |
| へいname、ちょっとお茶しない? | |
| nameと一緒にTwitterできてぼくは本当に幸せだよ | |
| オレの彼女になってくれないかな…好きだよ! | |
| nameにフォローされてからずっと、nameのことばかり考えていました。愛してる | |
| 気持ちいいよー。俺が。 | |
| /; | |
| my $nt = Net::Twitter->new( | |
| traits => [qw/API::REST/], | |
| username => 'username', | |
| password => 'password', | |
| ); | |
| if ( my $followers = $nt->followers ) { | |
| my $target_user = shuffle( @$followers ); | |
| my $screen_name = $target_user->{screen_name}; | |
| my $text = shuffle( @nanpa_text ); | |
| eval { $text =~ s/name/$screen_name/ }; | |
| $text = "\@$screen_name " . $text; | |
| $nt->update( $text ); | |
| warn "$text\n"; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment