Last active
December 18, 2015 04:39
-
-
Save sng2c/5727160 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use 5.010; | |
use Net::MyPeople::Bot; | |
use Data::Printer; | |
my $APIKEY = $ENV{MYPEOPLE_APIKEY}; | |
my $bot = Net::MyPeople::Bot->new({apikey=>$APIKEY}); | |
my $from = 0; | |
my $to = 1500; | |
my $before=0; | |
while($to != $from ){ | |
my $half = $from + int(($to - $from) / 2); | |
last if( $before == $half ); | |
say "$from..$to - send $half"; | |
my $res; | |
$res = $bot->send('BU_wqPHjxmJKIxKcIrAQu-JiA00', 'X' x $half ); | |
#$res = $bot->groupSend('GID_WZrl1', 'X' x $half ); | |
p $res; | |
if( $res->{code} eq '200' ){ | |
$from = $half; | |
} | |
else{ | |
$to = $half; | |
} | |
$before = $half; | |
} | |
say "MAX LENGTH : ".$before; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
groupSend 테스트 0~5000