Skip to content

Instantly share code, notes, and snippets.

@ajsharp
Created October 5, 2012 23:08
Show Gist options
  • Select an option

  • Save ajsharp/3842988 to your computer and use it in GitHub Desktop.

Select an option

Save ajsharp/3842988 to your computer and use it in GitHub Desktop.
# See https://www.fededirectory.frb.org/format.cfm
#
# Run this by doing `ruby parser.rb`
require 'rubygems'
require 'json'
require 'sinatra'
$db = {}
contents = File.foreach 'fpddir.txt' do |line|
number = line[0..8]
# telname = line[9..26]
custname = line[27..62].strip
$db[number] = custname
end
# GET /bank_name?number=23413421
get '/bank_name' do
number = params['number']
JSON.generate({:name => $db[number]})
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment