Skip to content

Instantly share code, notes, and snippets.

@tony-o
Created January 21, 2014 19:05
Show Gist options
  • Save tony-o/8546145 to your computer and use it in GitHub Desktop.
Save tony-o/8546145 to your computer and use it in GitHub Desktop.
6 <script>
7 var delicious = {
8 % use JSON::Tiny qw{j};
9 % my $count = 0;
10 % for my $e (@{$stash->{employers}}) {
11 % my $hash = {};
12 % for (keys $e->{_result_source}->{_columns}) {
13 % $hash->{$_} = $e->{_column_data}->{$_} || undef;
14 % }
15 %== ($count++ != 0 ? ',' : '') . $hash->{eid} . ': ' . j($hash)
16 % }
17 };
18 </script>
@tony-o
Copy link
Author

tony-o commented Jan 21, 2014

    var delicious = {
      4: {"jobclass":2,"uid":3,"eid":4,"enddt":null,"state":1,"employer":"test","startdt":"0001-01-01","city":"test","phonenumber":"1234567890","contactok":1,"jobtitle":"test"}
      ,3: {"jobclass":2,"uid":3,"eid":3,"enddt":null,"state":1,"employer":"wairyaweipuyr","startdt":"2013-09-12","city":"fioaifhwoa","phonenumber":null,"contactok":null,"jobtitle":"reioauroi"}
      ,2: {"jobclass":2,"uid":3,"eid":2,"enddt":null,"state":1,"employer":"test 2","startdt":"2014-01-17","city":"4324","phonenumber":null,"contactok":null,"jobtitle":"test"}
      ,1: {"jobclass":2,"uid":3,"eid":1,"enddt":"2014-01-31","state":5,"employer":"Test Employer 1","startdt":"2014-01-23","city":"Sacramento","phonenumber":null,"contactok":null,"jobtitle":"Some Job"}
    };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment