This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
took: 3, | |
timed_out: false, | |
_shards: { | |
total: 5, | |
successful: 5, | |
failed: 0 | |
}, | |
hits: { | |
total: 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
municipalities: { | |
document: { | |
properties: { | |
classification: { | |
type: "string", | |
index: "not_analyzed" | |
}, | |
content_url: { | |
type: "string", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Organization.order(:state).each do |org| | |
org_dir = "#{org.state.downcase}/#{org.name.downcase.gsub(/[^[:alnum:]]/,'_').gsub(/-{2,}/,'_')}/#{Time.now.year}" | |
expense_file = "#{org.slug}-#{Time.now.year}-expense.csv" | |
revenue_file = "#{org.slug}-#{Time.now.year}-revenue.csv" | |
FileUtils.mkdir_p(org_dir) | |
File.new("#{org_dir}/#{expense_file}", "w+").close | |
File.new("#{org_dir}/#{revenue_file}", "w+").close | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'typhoeus' | |
require 'nokogiri' | |
require 'uri' | |
require 'json' | |
require 'calais' | |
BASE_URL = 'http://www.ci.watertown.ma.us' | |
# the request object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'csv' | |
require 'typhoeus' | |
require 'json' | |
GOOGLE_GEO_URL = "http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=" | |
# Create the output file | |
CSV.open("geo-coded-permits.csv", "wb") do |csv| |
NewerOlder