Created
April 24, 2012 13:00
-
-
Save sharifulin/2479453 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
$list = [ | |
grep { | |
my $what; | |
$what->{retweet} = !!$_->{retweeted_status}; | |
$what->{reply } = !!$_->{in_reply_to_user_id_str}; | |
$what->{tweet } = !$what->{retweet} && !$what->{reply}; | |
warn qq(It's tweet "$what->{tweet}", reply "$what->{reply}", retweet "$what->{retweet}": $_->{text}\n); | |
my $yes; | |
if (grep { $task->{$_} } qw(only_tweet only_reply only_retweet)) { | |
$yes += $task->{only_tweet } && $what->{tweet } ? 1 : 0; | |
$yes += $task->{only_reply } && $what->{reply } ? 1 : 0; | |
$yes += $task->{only_retweet} && $what->{retweet} ? 1 : 0; | |
} | |
else { | |
$yes++; | |
} | |
$yes; | |
} | |
@$list | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment