Permalink
Browse files

Add more tweaks

  • Loading branch information...
1 parent 5c9ce24 commit 0949d2068b302b5c79f606ee88f9e6b134388955 @lukec committed Feb 23, 2013
Showing with 1,608 additions and 6 deletions.
  1. +13 −1 bin/parse
  2. +6 −2 dashboards/issues.erb
  3. +3 −0 jobs/rentals.rb
  4. +2 −2 jobs/twitter.rb
  5. +1,584 −1 metrics.json
View
@@ -14,10 +14,22 @@ my $data = decode_json io('data.json')->slurp;
my %metrics = (
total_outstanding => $data->{stats}{total_outstanding},
- outstanding_by_unit_size => $data->{stats}{by_units},
properties_with_issues => scalar(keys %{$data->{by_address}}),
);
+# Order up the unit size metrics
+my %by_unit;
+for my $label (keys %{$data->{stats}{by_units}}) {
+ $label =~ m/^(\w+)_(\d+)$/;
+ $by_unit{ $label } = {
+ label => ucfirst($1) . ' ' . $2 . ' units',
+ value => $data->{stats}{by_units}{$label},
+ };
+}
+for my $l (qw/under_20 under_50 under_80 under_110 under_140 over_140/) {
+ push @{$metrics{outstanding_by_unit_size}}, $by_unit{$l};
+}
+
# Top Infractors
my $all_ops = $data->{by_operator};
$metrics{total_infractors} = keys %$all_ops;
View
@@ -2,7 +2,7 @@
$(function() {
// These settings override the defaults set in application.coffee. You can do this on a per dashboard basis.
// Dashing.gridsterLayout('[{"col":2,"row":1},{"col":1,"row":1},{"col":3,"row":1},{"col":2,"row":2},{"col":3,"row":2},{"col":1,"row":2},{"col":5,"row":1},{"col":4,"row":2},{"col":2,"row":3}]')
- Dashing.widget_base_dimensions = [370, 340]
+ Dashing.widget_base_dimensions = [360, 330]
Dashing.numColumns = 5
});
</script>
@@ -31,6 +31,10 @@ $(function() {
<div data-id="top_infractors" data-view="List" data-unordered="false" data-title="Worst Infractors" data-moreinfo="# of current issues"></div>
</li>
+ <li data-row="3" data-col="4" data-sizex="1" data-sizey="1">
+ <div data-id="by_size" data-view="List" data-unordered="true" data-title="Issues by Unit Size"></div>
+ </li>
+
<li data-row="2" data-col="3" data-sizex="2" data-sizey="1">
<div data-id="latest_issues" data-view="Comments" data-title="Latest Issues" data-moreinfo="Issues from this month" ></div>
</li>
@@ -40,7 +44,7 @@ $(function() {
</li>
<li data-row="3" data-col="2" data-sizex="2" data-sizey="1">
- <div data-id="twitter_mentions" data-view="Comments" style="background-color:#ff9618;" data-moreinfo="Tweets tagged with #vodhd13"></div>
+ <div data-id="twitter_mentions" data-view="Comments" style="background-color:#ff9618;" data-moreinfo="Open Data Day Tweets - #opendataday"></div>
<i class="icon-twitter icon-background"></i>
</li>
View
@@ -11,6 +11,9 @@
}
send_event('top_infractors', { items: infractors })
+ send_event('by_size', { items: data["outstanding_by_unit_size"] })
+
+
latest_issues = data["latest_issues"].map { |x|
{ name: "Operator: " + x["operator"], body: x["desc"] }
}
View
@@ -1,7 +1,7 @@
require 'net/http'
require 'json'
-search_term = URI::encode('#todayilearned')
+search_term = URI::encode('#opendataday')
SCHEDULER.every '10m', :first_in => 0 do |job|
http = Net::HTTP.new('search.twitter.com')
@@ -14,4 +14,4 @@
send_event('twitter_mentions', comments: tweets)
end
-end
+end
View
1,585 metrics.json

Large diffs are not rendered by default.

Oops, something went wrong.

0 comments on commit 0949d20

Please sign in to comment.