projects
/
webservice-strike.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a33f056
)
Lowercase keys in strike_imdb response
author
Marius Gavrilescu
<marius@ieval.ro>
Sat, 8 Aug 2015 10:29:08 +0000
(13:29 +0300)
committer
Marius Gavrilescu
<marius@ieval.ro>
Sat, 8 Aug 2015 10:29:08 +0000
(13:29 +0300)
lib/WebService/Strike.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/WebService/Strike.pm
b/lib/WebService/Strike.pm
index b985840e44ecb0639fa52ae825c9f1cf9f332168..e59707e66edabec11716a399eb77c60cf50c4da5 100644
(file)
--- a/
lib/WebService/Strike.pm
+++ b/
lib/WebService/Strike.pm
@@
-56,7
+56,9
@@
sub strike_imdb {
my $url = "$BASE_URL/media/imdb/?imdbid=$id";
my $response = _ht->get($url);
return unless $response->{success};
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 }
}
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 join ' ', @{$mp->file_names};
my $info = strike_imdb 'tt1520211';
- say 'IMDB ID ', $info->{imdb
ID
}, ' is ', $info->{title}, ' (', $info->{year}, ')';
- say 'Plot (short): ', $info->{short
P
lot};
+ say 'IMDB ID ', $info->{imdb
id
}, ' is ', $info->{title}, ' (', $info->{year}, ')';
+ say 'Plot (short): ', $info->{short
p
lot};
=head1 DESCRIPTION
=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
=item B<strike_imdb>(I<$imdb_id>)
Get informaton about a movie from IMDB. Takes an IMDB ID and returns a
-hash
ef of unspecified format
.
+hash
ref of unspecified format. All keys are lowercased
.
=back
=back
This page took
0.011828 seconds
and
4
git commands to generate.