X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FWebService%2FStrike.pm;h=070a2a5d2f875f710eb5a6e2f9f2653cda64a1df;hb=refs%2Fheads%2Fmaster;hp=001972de9a8c71542ab90c48b40b81860703d34d;hpb=0eff1663d01977542009b247f9632a891d8a6a87;p=webservice-strike.git diff --git a/lib/WebService/Strike.pm b/lib/WebService/Strike.pm index 001972d..070a2a5 100644 --- a/lib/WebService/Strike.pm +++ b/lib/WebService/Strike.pm @@ -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.003'; +our $VERSION = '0.006'; 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 } @@ -68,7 +70,7 @@ __END__ =head1 NAME -WebService::Strike - Get torrent info from getstrike.net API +WebService::Strike - [OBSOLETE] Get torrent info from the now-discontinued getstrike.net API =head1 SYNOPSIS @@ -88,11 +90,14 @@ 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 +B + Strike API is a service for getting information about a torrent given its info hash. WebService::Strike is a wrapper for this service. @@ -129,7 +134,7 @@ For example: =item B(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 @@ -143,7 +148,7 @@ Marius Gavrilescu, Emarius@ieval.roE =head1 COPYRIGHT AND LICENSE -Copyright (C) 2015 by Marius Gavrilescu +Copyright (C) 2015-2016 by Marius Gavrilescu This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.20.2 or,