Skip to content

Instantly share code, notes, and snippets.

@yusukebe
Created August 1, 2009 07:13
Show Gist options
  • Select an option

  • Save yusukebe/159595 to your computer and use it in GitHub Desktop.

Select an option

Save yusukebe/159595 to your computer and use it in GitHub Desktop.
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