Your SlideShare is downloading. ×
0
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
TerminalでTwitter
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

TerminalでTwitter

1,403

Published on

Perl Casual Talks#1 の発表資料です。 …

Perl Casual Talks#1 の発表資料です。
http://perl-casual.org/2009/11/casual-talks1-1.html

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,403
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Transcript

    • 1. my $profile = { name => ' ', id => 'sugyan', age => 26, };
    • 2. perl -MText::MeCab -MNet::Twitter -MEncode=encode_utf8 -e ' my $t = '''Net::Twitter'''->new('''username''', ''sugy an''', '''password''', '''******''');my $statuses = $t ->friends_timeline;my $status = $$statuses[rand @$statuses] ;my $text = encode_utf8($$status{'''text'''});my $user = $$status{'''user'''}{'''screen_name'''};$text =~ s/ [^ s]+ /z($&);/egmsx;$t->update("@$user 343201214350250 200343201243343201237: $text");sub z {my $text = shif t @_;my $zenra = "345205250350243270343201247";my $mecab = '''Text::MeCab'''->new;my $n = $mecab->parse($te xt);my $output = '''''';$n = $n->next while $n->next;my $ flg = 0;while (($n = $n->prev)->prev) {if ($flg) {my $inser t = 1;if ($n->feature =~ / A (345220215350251236|34 5211257350251236|345213225350251236) /msx) {$ins ert = 0;}elsif ($n->feature =~ / A 345212251(3452132 25)?350251236 /msx and (split(/,/, $n->prev->feature, 0) )[5] =~ / 351200243347224250 /msx) {$insert = 0;}if ( $insert) {$output = $zenra . $output;$flg = 0;}}$output = $ n->surface . $output;if ($n->feature =~ / A 3452132253 50251236 /msx) {$flg = 1;}}if ($flg) {$output = $zenra . $output;}return $output;}'

    ×