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| |
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
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
{ | |
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
{ | |
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
19:40John B.: Hello Matt! How may I help you? | |
19:41Matt M.: Hi John. I need to lower my bill. Comcast internet is much cheaper. Thinking of switching | |
19:43Matt M.: They are offering me $34.99/mo my latest RCN bill is $49.99 | |
19:43John B.: Let me see what I can do, sir. I'd be happy to help you. May I please have your address and phone number? | |
19:44Matt M.: Sure. XXXXXXXXX, MA XXXXX and my phone number is XXX-XXX-XXXX. | |
19:45John B.: Thank you sir. One moment please while I research what I can do. | |
19:45Matt M.: Great thanks. | |
19:48John B.: I tried to put you in the $34.99 plan, however the system knows your an active customer and denies me. | |
19:49John B.: But we do have another option! | |
19:49Matt M.: OK. What are you thinking? |
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 'tire' | |
Tire.configure { logger 'elasticsearch.log', :level => 'debug' } | |
class Municipality | |
include Tire::Model::Persistence | |
include Tire::Model::Search | |
include Tire::Model::Callbacks |
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 'net/http' | |
# Memory continues to climb. | |
idx = 0 | |
loop do | |
begin | |
# Our sample website | |
url = "http://localhost:2000" | |
resp = Net::HTTP.get(URI.parse(url)) | |
puts "run loop: #{idx}" |
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
08:51:20 worker.1 | 2012-12-31T13:51:20Z 11451 TID-ovw3jav00 ExtractTextFromDocument JID-21e38454b9696092b4b8313c WARN: !!! Failure ExtractTextFromDocument(56410) | |
08:51:20 worker.1 | 2012-12-31T13:51:20Z 11451 TID-ovw3jav00 ExtractTextFromDocument JID-21e38454b9696092b4b8313c DEBUG: Failure! Retry 5 in 742 seconds | |
08:51:20 worker.1 | 2012-12-31T13:51:20Z 11451 TID-ovw3jav00 ExtractTextFromDocument JID-21e38454b9696092b4b8313c INFO: fail: 42.405 sec | |
08:51:20 worker.1 | 2012-12-31T13:51:20Z 11451 TID-ovw3jav00 WARN: {"retry"=>10, "queue"=>"high", "class"=>"ExtractTextFromDocument", "args"=>[56410, "Workflow.end_extract_text(arg)"], "jid"=>"21e38454b9696092b4b8313c", "error_message"=>"!!! Caught exception while executing ExtractTextFromDocument(56410): Text extraction service error: (503)", "error_class"=>"StandardError", "failed_at"=>"2012-12-30T20:28:13Z", "retry_count"=>5, "retried_at"=>2012-12-31 13:51:20 UTC} | |
08:51:20 worker.1 | 2012-12-31T13:51:20Z 11451 TID-ovw3jav00 WARN: !!! Caught exception while execu |
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
Topic 00 4060.638381492015 | |
number 131.84254459571682 | |
dwelling 130.0942066586498 | |
name 107.50313007741401 | |
state 107.23074287437205 | |
unit 94.60188337501059 | |
address 83.35383631029445 | |
code 75.011551118471 | |
yes 68.04857715759431 | |
owner 65.04524048536197 |
OlderNewer