Show
Ignore:
Timestamp:
11/15/07 00:27:42 (7 years ago)
Author:
tomyhero
Message:

lang/perl/Net-Twitter-FriendFinder?: Ready for CAPN release.

Location:
lang/perl/Net-Twitter-FriendFinder/trunk
Files:
1 added
5 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Net-Twitter-FriendFinder/trunk/Changes

    r1408 r1514  
    11Revision history for Net-Twitter-FriendFinder 
     2 
     30.02       2007-11-15/00:18 
     4           - first release to CPAN 
     5 
     60.01_08    2007-11-14/19:29 
     7           - use Net::Twitter::Diff insetead of Net::Twitter 
    28 
    390.01_07    2007-11-14/00:19 
     
    1723             for this fix you must set username and passowrd at new() parameters 
    1824           - support sleep setting.  
     25 
    19260.01_02    2007-11-08/00:21 
    2027           - Bug Fix: can not load custom resource module. 
     28 
    21290.01_01    2007-11-07/23:31 
    2230           -First version, released on an unsuspecting world. 
  • lang/perl/Net-Twitter-FriendFinder/trunk/MANIFEST

    r1217 r1514  
    88lib/Net/Twitter/FriendFinder/From/Google.pm 
    99lib/Net/Twitter/FriendFinder/From/Twitter.pm 
     10lib/Net/Twitter/FriendFinder/From/TwitterDiff.pm 
     11lib/Net/Twitter/FriendFinder/From/TwitterKensaku.pm 
     12lib/Net/Twitter/FriendFinder/From/URL.pm 
    1013t/00-load.t 
    1114t/boilerplate.t 
  • lang/perl/Net-Twitter-FriendFinder/trunk/Makefile.PL

    r1217 r1514  
    1414        'URI'                   => 0, 
    1515        'URI::Escape'           => 0, 
    16         'Net::Twitter'          => 0, 
     16        'Net::Twitter::Diff'    => 0, 
    1717        'Text::SimpleTable'     => 0, 
    1818        'Class::Accessor::Fast' => 0, 
  • lang/perl/Net-Twitter-FriendFinder/trunk/lib/Net/Twitter/FriendFinder.pm

    r1408 r1514  
    77__PACKAGE__->mk_accessors(qw/default from setting ids scores resources filters)/); 
    88use Text::SimpleTable; 
    9 use Net::Twitter; 
    10  
    11 our $VERSION = '0.01_07'; 
    12  
    13 # Net::Twitter HACK. I know this is not good way to do this. 
    14 # REASON: Net::Twitter->following only allow to retrive 100 limit. 
    15 sub Net::Twitter::following_screen_names_ref { 
    16     my ( $self ) = @_; 
    17  
    18     my @screen_names = (); 
    19     # limit 20 pages for now.( 2000 twitters ) 
    20     my @pages = (1..20); 
    21     for my $page ( @pages ) { 
    22         my $url = $self->{apiurl} . "/statuses/friends.json?page=$page" ; 
    23         my $req = $self->{ua}->get($url); 
    24  
    25         die 'fail to connect to twitter. maybe over Rate limit exceeded' unless $req->is_success; 
    26         my $res = JSON::Any->jsonToObj($req->content) ; 
    27          
    28         last unless scalar @{ $res } ; 
    29  
    30         for my $item ( @{ $res } ) { 
    31             push @screen_names , $item->{screen_name}; 
    32         } 
    33     } 
    34  
    35     return \@screen_names; 
    36      
    37 } 
     9use Net::Twitter::Diff; 
     10 
     11our $VERSION = '0.02'; 
     12 
    3813 
    3914sub search { 
     
    6843 
    6944    if( $self->{setting}{filter_already_followers} ) { 
    70         my $twitter = Net::Twitter->new( username=> $self->{setting}{username} , password => $self->{setting}{password} ); 
    71         my $screen_names = $twitter->following_screen_names_ref(); 
     45        my $twitter = Net::Twitter::Diff->new( username=> $self->{setting}{username} , password => $self->{setting}{password} ); 
     46        my $xfollowing = $twitter->xfollowing; 
     47     
    7248        my @filters = (); 
    7349 
    74         for my $screen_name ( @{ $screen_names } ) { 
     50        for my $item ( @{ $xfollowing } ) { 
     51            my $screen_name = $item->{screen_name} ; 
    7552            if( defined $data->{ $screen_name } ) { 
    7653                push @filters , { id => $screen_name , score =>  $data->{ $screen_name } }; 
     
    162139=head1 DESCRIPTION 
    163140 
    164 Hello. I started twitter but I did not have much friends,  since I am shay, so that I created this 
     141Hello. I started twitter but I did not have much friends.  Since I am shay, so that I created this 
    165142module. 
    166143 
    167 You can find twitter friends by using keyword search, of course you can follow friends whith this module. 
    168  
    169 INTERFACE MAY CHANGE IN THE FUTURE. STILL UNDER DEVELOPMENT. 
     144You can find twitter friends by using keyword search and then you can follow friends whith this module. 
    170145 
    171146=head1 SYNOPSYS 
     
    204179You should set configulation here. 
    205180 
    206 ** setting 
    207  
    208  
    209 limit - you can set limit for how many friends you want to find for max.  
    210  
    211 on_echo - when on_echo = 1 then , $tf->follow() method print out who you are going to follow. 
    212  
    213 username - twitter username 
    214  
    215 password - twitter password 
    216  
    217 sleep - since Twitter API has request count limitation, you may want to set sleep time when you try to follow a lot of people. 
     181=over 2  
     182 
     183=item B<setting> 
     184 
     185=back 
     186 
     187=over 4 
     188 
     189=item ->{limit} 
     190 
     191you can set limit for how many friends you want to find for max.  
     192 
     193=item ->{on_echo} 
     194 
     195when on_echo = 1 then , $tf->follow() method print out who you are going to follow. 
     196 
     197=item ->{username} 
     198 
     199twitter username 
     200 
     201=item ->{password} 
     202 
     203twitter password 
     204 
     205=item ->{sleep} 
     206 
     207since Twitter API has request count limitation, you may want to set sleep time when you try to follow a lot of people. 
    218208 
    219209filter_already_followers - when true, it will check your current followers and not try to follow again. required username and password for this. NOTICE: you may miss some friends to filter who add recently because Twitter API does not return them. 
    220210 
    221 ** default 
     211=back 
     212 
     213=over 2 
     214 
     215=item B<default> 
    222216 
    223217you can set default setting here.  
    224218 
    225 coverage - you can set how much you cover. It depend on where you get resource from , so check the resource POD. 
    226  
    227 ** from 
     219=back 
     220 
     221=over 4 
     222 
     223 
     224=item ->{coverage} 
     225 
     226you can set how much you cover. It depend on where you get resource from , so check the resource POD. 
     227 
     228=back 
     229 
     230=over 2 
     231 
     232=item B<from> 
    228233 
    229234You can set where to search friends from. you can find resource from Net::Twitter::FriendFinder::From::* 
     
    241246 }, 
    242247 
     248=back 
     249 
    243250=head2 search 
    244251 
     
    254261should check who you are going t follow with show() method. 
    255262 
    256  =head1 HOW TO MAKE YOUR OWN RESOURCE 
    257  
    258  this is just simple one. 
     263=head1 HOW TO MAKE YOUR OWN RESOURCE 
     264 
     265this is just simple one. 
    259266 
    260267    package My::Recomend::User; 
     
    288295=head1 SEE ALSO 
    289296 
    290 L:<Net::Twitter> 
    291  
    292 L:<Net::Twitter::FriendFinder::From::Google> 
    293  
    294 L:<Net::Twitter::FriendFinder::From::Twitter> 
    295  
    296 L:<Net::Twitter::FriendFinder::From::TwitterKensaku> 
    297  
    298 L:<Net::Twitter::FriendFinder::From::TwitterDiff> 
    299  
    300 L:<Net::Twitter::FriendFinder::From::URL> 
     297L<Net::Twitter> 
     298 
     299L<Net::Twitter::FriendFinder::From::Google> 
     300 
     301L<Net::Twitter::FriendFinder::From::Twitter> 
     302 
     303L<Net::Twitter::FriendFinder::From::TwitterKensaku> 
     304 
     305L<Net::Twitter::FriendFinder::From::TwitterDiff> 
     306 
     307L<Net::Twitter::FriendFinder::From::URL> 
    301308 
    302309=head1 AUTHOR 
  • lang/perl/Net-Twitter-FriendFinder/trunk/lib/Net/Twitter/FriendFinder/From/Google.pm

    r1217 r1514  
    6060=head1 SYNOPSYS 
    6161 
    62  
    6362   use strict; 
    6463   use warnings;