Changeset 103 in lab


Ignore:
Timestamp:
Jan 10, 2011 3:55:26 PM (13 years ago)
Author:
mitty
Message:
  • change skip flag logic
  • bot behavior and results are not changed
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Dev/twitter/twitterbot.pl

    r102 r103  
    4949    # $tweets->{$id}{type} eq 'search'  => found by search API 
    5050    #                      eq 'mention' => found by mention API 
     51    my $skip; 
    5152    if ($tweets->{$id}{type} eq 'retweet') { 
    5253        DEBUG and warn "skipping $id that was already retweeted\n"; 
    53         next; 
     54        $skip = $id; 
    5455    } 
    5556    if (defined $conf->{allow}) { 
    56         my $flag; 
     57        $skip = $id; 
    5758        foreach my $screen_name ( @{ $conf->{allow}{screen_name} } ) { 
    5859            if ($tweets->{$id}{screen_name} eq $screen_name) { 
    5960                DEBUG and warn "$id was allowed by screen_name\n"; 
    60                 $flag = $id; 
     61                undef $skip; 
    6162                last; 
    6263            } 
     
    6566            if ($tweets->{$id}{user_id} eq $user_id) { 
    6667                DEBUG and warn "$id was allowed by user_id\n"; 
    67                 $flag = $id; 
     68                undef $skip; 
    6869                last; 
    6970            } 
    7071        } 
    71         if (! $flag) { 
    72             next; 
    73         } 
     72    } 
     73     
     74    if ($skip) { 
     75        next; 
    7476    } 
    7577     
Note: See TracChangeset for help on using the changeset viewer.