Skip to content

Instantly share code, notes, and snippets.

@paveljurca
Created December 14, 2015 18:22
Show Gist options
  • Save paveljurca/d5ef24e5c9de58303375 to your computer and use it in GitHub Desktop.
Save paveljurca/d5ef24e5c9de58303375 to your computer and use it in GitHub Desktop.
make JSON to URL
use strict;
use warnings;
my $param;
while (<DATA>) {
chomp;
#s/^\s+|\s+$/g;
$param .= (join "=", split /:/)."&";
}
$param =~ s/[\s',]+//g;
chop($param); # cutting the last '&'
print $param . "\n";
__DATA__
site: '30',
realSite: '30',
subsite: '746',
autoStart: '1',
autoSound: '0',
section: '3607',
media: '1741518',
mute: '0',
size: '',
pWidth: 600,
pHeight: 383,
counter: '13260',
jsVar: 'vjsconfig13260',
pid: 'vjsplayer_13260',
revision: '158978',
fallback: useFlowplayer13260
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment