]> iEval git - webservice-strike.git/blobdiff - lib/WebService/Strike.pm
Use HTTPS and include diagnostics in test
[webservice-strike.git] / lib / WebService / Strike.pm
index 396ec48676ba61990710417fc734ec9d17032f99..74a8c2b30ab05bc82315d92c245944b0bcce6614 100644 (file)
@@ -7,15 +7,15 @@ 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 $BASE_URL = 'http://getstrike.net/api/v2/torrents';
+our $VERSION = '0.003';
+our $BASE_URL = 'https://getstrike.net/api/v2/torrents';
 
 use JSON::MaybeXS qw/decode_json/;
 use HTTP::Tiny;
 use Sort::ByExample qw/sbe/;
 use WebService::Strike::Torrent;
 
-sub _ht { HTTP::Tiny->new(agent => "WebService-Strike/$VERSION") }
+sub _ht { HTTP::Tiny->new(agent => "WebService-Strike/$VERSION", verify_SSL => 1) }
 
 sub _query {
        my ($url) = @_;
@@ -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 }});
@@ -115,7 +118,7 @@ For example:
 
 =head1 SEE ALSO
 
-L<WebService::Strike::Torrent>, L<http://getstrike.net/api/>, L<WWW::Search::Torrentz>
+L<WebService::Strike::Torrent>, L<https://getstrike.net/api/>, L<WWW::Search::Torrentz>
 
 =head1 AUTHOR
 
This page took 0.017246 seconds and 4 git commands to generate.