X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FWebService%2FStrike.pm;h=bf51deb54147c0fef1128d832a1032b417b88534;hb=828fd38560522ff13a64f53645c52df0e7b21843;hp=396ec48676ba61990710417fc734ec9d17032f99;hpb=95b1c120488fa6a756ab596060099f85921dae73;p=webservice-strike.git diff --git a/lib/WebService/Strike.pm b/lib/WebService/Strike.pm index 396ec48..bf51deb 100644 --- a/lib/WebService/Strike.pm +++ b/lib/WebService/Strike.pm @@ -7,7 +7,7 @@ use parent qw/Exporter/; our @EXPORT = qw/strike strike_search/; ## no critic (ProhibitAutomaticExportation) our @EXPORT_OK = qw/strike_query strike strike_search/; -our $VERSION = '0.002'; +our $VERSION = '0.003'; our $BASE_URL = 'http://getstrike.net/api/v2/torrents'; use JSON::MaybeXS qw/decode_json/; @@ -30,6 +30,9 @@ sub _query { sub strike_query { my (@hashes) = @_; + if (@hashes > 50) { + return strike_query (@hashes[0 .. 49]), strike_query (@hashes[50 .. $#hashes]); + } my $url = "$BASE_URL/info/?hashes=" . join ',', map { uc } @hashes; my $sorter = sbe(\@hashes, {xform => sub { $_[0]->hash }});