x
Search Posts:
BLOG POST #135 SHOW ALL

How to tweetstorm with a bunch of Perl code lines

Requirements:
- An unix-like shell with Perl
- A twitter account to retweet who mentions an hashtag
- TTYtter : http://www.floodgap.com/software/ttytter/

Steps:
1) Authenticate TTYtter

2) Create a file "tweetstorm.pl" and configure your search string in the "$track" variable:
----------------
die("I can't run anonymously") if ($anonymous);

$track = '#socialstrike'; # The search key to query twitter api with
$notimeline = 1;

$store->{'dontecho'} = $whoami; # this is the username

$handle = sub {
        my $ref = shift;
        my $sn = &descape($ref->{'user'}->{'screen_name'});
        
        return if ($sn eq $store->{'dontecho'});

        my $rtstring = "\/rt $ref->{'id_str'}";
        &ucommand($rtstring); # ReTweet all matching tweets

        my $favstring = "\/fav $ref->{'id_str'}";
        &ucommand($favstring); # Favorite all matching tweets

        my $tweettxt = &descape($ref->{'text'});
        &ucommand($tweettxt); # Tweet a new tweet copying any matching tweet
        
        &defaulthandle($ref);
        return 1;
};
----------------

3) Run in a terminal:
user@machine:~$ ttytter -exts=tweetstorm.pl -verbose=1