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; |
groupSend 테스트 0~5000
0..5000 - send 2500
\ {
code 400,
message "Content length invalid"
}
0..2500 - send 1250
\ {
code 400,
message "Content length invalid"
}
0..1250 - send 625
\ {
code 200,
message "Success"
}
625..1250 - send 937
\ {
code 200,
message "Success"
}
937..1250 - send 1093
\ {
code 400,
message "Content length invalid"
}
937..1093 - send 1015
\ {
code 400,
message "Content length invalid"
}
937..1015 - send 976
\ {
code 200,
message "Success"
}
976..1015 - send 995
\ {
code 200,
message "Success"
}
995..1015 - send 1005
\ {
code 400,
message "Content length invalid"
}
995..1005 - send 1000
\ {
code 200,
message "Success"
}
1000..1005 - send 1002
\ {
code 400,
message "Content length invalid"
}
1000..1002 - send 1001
\ {
code 400,
message "Content length invalid"
}
1000..1001 - send 1000
\ {
code 200,
message "Success"
}
MAX LENGTH : 1000
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
send 테스트 0~1500