source: freethepostcode.org/html/bin/currentlist.rb @ 726

Last change on this file since 726 was 726, checked in by Dominic Hargreaves, 11 years ago

initial import

  • Property svn:executable set to *
File size: 406 bytes
Line 
1#!/usr/bin/ruby
2
3
4
5require 'singleton'
6load '/srv/www/freethepostcode.org/html/ruby/dao.rb'
7
8puts '# Generated daily'
9
10dao = OSM::Dao.instance
11
12res = dao.call_sql { 'select format(avg(lat),6) as lat, format(avg(lon),6) as lon, part1, part2 from codes where confirmed = 1 group by part1, part2;' }
13
14
15res.each_hash do |row|
16  puts row['lat'] + ' ' + row['lon'] + ' ' + row['part1'] + ' ' + row['part2']
17end
18
Note: See TracBrowser for help on using the repository browser.