]> iEval git - webservice-strike.git/blobdiff - lib/WebService/Strike.pm
Update for API V2.1
[webservice-strike.git] / lib / WebService / Strike.pm
index 8d9b33d09c8e051f3d724dc1caa0ebb675c1cce0..1b2be6f632cf7826652df09dd577063f3d23e06f 100644 (file)
@@ -5,9 +5,9 @@ use strict;
 use warnings;
 use parent qw/Exporter/;
 
-our @EXPORT    = qw/strike strike_search strike_imdb/; ## no critic (ProhibitAutomaticExportation)
+our @EXPORT    = qw/strike strike_search strike_imdb/;
 our @EXPORT_OK = (@EXPORT, 'strike_query');
-our $VERSION = '0.004';
+our $VERSION = '0.004003';
 our $BASE_URL = 'https://getstrike.net/api/v2';
 
 use JSON::MaybeXS qw/decode_json/;
@@ -56,7 +56,9 @@ sub strike_imdb {
        my $url = "$BASE_URL/media/imdb/?imdbid=$id";
        my $response = _ht->get($url);
        return unless $response->{success};
-       decode_json $response->{content}
+       my %imdb = %{decode_json $response->{content}};
+       $imdb{lc $_} = delete $imdb{$_} for keys %imdb; ## no critic (ProhibitUselessTopic)
+       \%imdb
 }
 
 BEGIN { *strike = \&strike_query }
@@ -88,8 +90,8 @@ WebService::Strike - Get torrent info from getstrike.net API
   say join ' ', @{$mp->file_names};
 
   my $info = strike_imdb 'tt1520211';
-  say 'IMDB ID ', $info->{imdbID}, ' is ', $info->{title}, ' (', $info->{year}, ')';
-  say 'Plot (short): ', $info->{shortPlot};
+  say 'IMDB ID ', $info->{imdbid}, ' is ', $info->{title}, ' (', $info->{year}, ')';
+  say 'Plot (short): ', $info->{shortplot};
 
 =head1 DESCRIPTION
 
@@ -129,7 +131,7 @@ For example:
 =item B<strike_imdb>(I<$imdb_id>)
 
 Get informaton about a movie from IMDB. Takes an IMDB ID and returns a
-hashef of unspecified format.
+hashref of unspecified format. All keys are lowercased.
 
 =back
 
This page took 0.020306 seconds and 4 git commands to generate.