Skip to content

Instantly share code, notes, and snippets.

Avatar

James jamescgibson

View GitHub Profile
View geocode_ips.rb
# Take a .csv file with IP addresses in a single column, and create a new file with the ip addresses
# and their associated ZIP codes
# Requires: Ruby, geocoder (gem install geocoder once ruby is installed
# Requies: File with ip addresses called ips.csv
require 'geocoder'
require 'csv'
ips = CSV.read("ips.csv").flatten