Changeset 702399e in lab.git for Dev


Ignore:
Timestamp:
Jan 10, 2011 3:55:26 PM (14 years ago)
Author:
mitty <mitty@…>
Branches:
master, trunk
Children:
45a20c3
Parents:
641934f
Message:
  • change skip flag logic
  • bot behavior and results are not changed

git-svn-id: https://lab.mitty.jp/svn/lab/trunk@103 7d2118f6-f56c-43e7-95a2-4bb3031d96e7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/twitter/twitterbot.pl

    r641934f r702399e  
    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.