Changeset 52c76fd in lab.git for Dev


Ignore:
Timestamp:
Sep 23, 2012 12:29:03 PM (12 years ago)
Author:
mitty <mitty@…>
Branches:
master, trunk
Children:
6852f37
Parents:
1727505
Message:
  • add search command
  • load search keyword from config.yaml and do OR search

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/twitter/dump_timeline.pl

    r2b6eb0b r52c76fd  
    1919    die <<EOM; 
    2020usage: $0 
    21     [{u}ser_timeline(default)|{r}etweeted_by_me|{m}sentions 
     21    [{u}ser_timeline(default)|{r}etweeted_by_me|{m}sentions|{s}earch 
    2222        [screen_name 
    2323            [number_of_pages|all 
     
    7070        elsif ($method eq 'mentions' || $method eq 'm') { 
    7171            $res = $bot->mentions($param); 
     72        } 
     73        elsif ($method eq 'search' || $method eq 's') { 
     74            my $key; 
     75            foreach my $word (@{ $conf->{hashtag} }) { 
     76                if ($key) { 
     77                    $key .= " OR $word"; 
     78                } 
     79                else { 
     80                    $key = $word; 
     81                } 
     82            } 
     83            $param->{q} = $key; 
     84            $res = $bot->search($param)->{results}; 
    7285        } 
    7386        else { 
Note: See TracChangeset for help on using the changeset viewer.