/[simile]/sparklines/create.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sparklines/create.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 25 by dpavlin, Fri Oct 17 14:23:04 2008 UTC revision 27 by dpavlin, Sun Oct 19 16:05:02 2008 UTC
# Line 71  foreach my $instance ( keys %$json ) { Line 71  foreach my $instance ( keys %$json ) {
71                  id => $instance,                  id => $instance,
72                  label => $instance,                  label => $instance,
73                  uri => "http://www.$instance.skole.hr",                  uri => "http://www.$instance.skole.hr",
74                    visits_sum => 0,
75                    visits_anonymous_sum => 0,
76                    changes_sum => 0,
77                    categories_changed_sum => 0,
78                    unique_users_sum => 0,
79          };          };
80          foreach my $type ( keys %{ $json->{$instance} } ) {          foreach my $type ( keys %{ $json->{$instance} } ) {
81                  foreach my $p ( keys %{ $json->{$instance}->{$type} } ) {                  foreach my $p ( keys %{ $json->{$instance}->{$type} } ) {
82                          $item->{ $type . '_' . $p } = $json->{$instance}->{$type}->{$p};                          my $val = $json->{$instance}->{$type}->{$p};
83                            $item->{ $type . '_' . $p } = $val;
84                  }                  }
85          }          }
86          push @items, $item;          push @items, $item;
# Line 82  foreach my $instance ( keys %$json ) { Line 88  foreach my $instance ( keys %$json ) {
88    
89  warn dump( @items );  warn dump( @items );
90    
91  write_file( 'sparklines.js', to_json({ items => \@items }) );  my $items_json = to_json({ items => \@items });
92    $items_json =~ s/(_sum":)"(\d+)"/$1$2/gs;
93    write_file( 'sparklines.js', $items_json );
94    

Legend:
Removed from v.25  
changed lines
  Added in v.27

  ViewVC Help
Powered by ViewVC 1.1.26