projects
/
lab.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* add new hash members to return value of or_search and mentions_ids
[lab.git]
/
twitter
/
twitterbot.pl
diff --git
a/twitter/twitterbot.pl
b/twitter/twitterbot.pl
index
7da7ec8
..
d1dd229
100755
(executable)
--- a/
twitter/twitterbot.pl
+++ b/
twitter/twitterbot.pl
@@
-14,8
+14,9
@@
use FindBin qw($Bin);
use YAML::Tiny;
use Date::Parse qw(str2time);
use YAML::Tiny;
use Date::Parse qw(str2time);
-sub VERBOSE () { $ARGV[0] eq 'verbose' };
-sub DEBUG () { VERBOSE or $ARGV[0] eq 'debug' };
+my $_execmode = $ARGV[0] || 0;
+sub VERBOSE () { $_execmode eq 'verbose' };
+sub DEBUG () { VERBOSE or $_execmode eq 'debug' };
use Data::Dumper;
DEBUG and warn "$0: debug mode";
use Data::Dumper;
DEBUG and warn "$0: debug mode";
@@
-154,9
+155,11
@@
sub or_search {
screen_name => $res->{user}{screen_name},
status_id => $res->{id},
text => $res->{text},
screen_name => $res->{user}{screen_name},
status_id => $res->{id},
text => $res->{text},
+ user_id => $res->{user}{id},
};
if ($res->{retweeted_status}) {
};
if ($res->{retweeted_status}) {
- $id->{type} = 'retweet';
+ $id->{retweet_of} = $res->{retweeted_status}{id};
+ $id->{type} = 'retweet';
}
else {
$id->{type} = 'search';
}
else {
$id->{type} = 'search';
@@
-205,6
+208,7
@@
sub mentions_ids {
status_id => $_->{id},
text => $_->{text},
type => 'mention',
status_id => $_->{id},
text => $_->{text},
type => 'mention',
+ user_id => $_->{user}{id},
}
} @{$res}
};
}
} @{$res}
};