Sha256: a2a955b288db7f65d0baa736ccfe2b8a94177018e09ca82a9f1a91f3368fcf79

Contents?: true

Size: 731 Bytes

Versions: 12

Compression:

Stored size: 731 Bytes

Contents

#! /usr/bin/env ruby

require 'csv'
require 'open-uri'
require './lib/gman'
require './lib/gman/importer'

url = "http://www.mik.nrw.de/nc/themen-aufgaben/kommunales/kommunale-adressen.html?tx_szkommunaldb_pi1%5Bexport%5D=csv"

csv = open(url).read.force_encoding("iso-8859-1").encode("UTF-8")

# For some reason, the header row is actually the last row
# Pop the last line off the file and prepend it at the begining
# So that when we pass it to CSV it detects the headers properly
lines = csv.split("\n")
lines.unshift lines.pop
csv = lines.join("\n")

# Load municipal domains
data = CSV.parse(csv, :headers => true, :col_sep => ";")
domains = data.map { |row| row["Internet"] }

Gman.import("German Municipalities" => domains)

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gman-5.0.9 script/vendor-municipal-de
gman-5.0.8 script/vendor-municipal-de
gman-5.0.7 script/vendor-municipal-de
gman-5.0.6 script/vendor-municipal-de
gman-5.0.5 script/vendor-municipal-de
gman-5.0.4 script/vendor-municipal-de
gman-5.0.3 script/vendor-municipal-de
gman-5.0.2 script/vendor-municipal-de
gman-5.0.1 script/vendor-municipal-de
gman-5.0.0 script/vendor-municipal-de
gman-4.7.1 script/vendor-municipal-de
gman-4.7.0 script/vendor-municipal-de