fix quoting in AsyncWgetFileGetter again
[videosite.git] / videosite / JSJSONArrayParser.pm
1 #
2 # A helper class for parsing textual JS hashes into perl 
3 # hashes
4 #
5 # This parser is based on the perl JSON module
6 #
7
8 package videosite::JSJSONArrayParser;
9
10 use videosite::JSArrayParser;
11 use JSON -support_by_pp;
12 @ISA = qw(videosite::JSArrayParser);
13
14 use strict;
15
16 sub new {
17     my $class = shift;
18     my $self = $class->SUPER::new();
19
20     return bless($self, $class);
21 }
22
23 sub parse {
24     my $self = shift;
25     my $s = shift;
26     my $j = JSON->new();
27     my $content;
28
29     ($content, undef) = $j->loose->allow_barekey()->allow_singlequote()->decode_prefix($s);
30     return $content;
31 }
32
33 1;