Sha256: 278e69348db08810fd6bc14a9819abaffc0b02cfbcccac116a8034cb4d7cd720

Contents?: true

Size: 616 Bytes

Versions: 12

Compression:

Stored size: 616 Bytes

Contents

#! /usr/bin/env ruby

require 'mechanize'
require 'csv'
require './lib/gman'
require './lib/gman/importer'

url = "http://www.myndighetsregistret.scb.se/Myndighet.aspx"
agent = Mechanize.new
page = agent.get(url)
form = page.forms.first
form.radiobuttons.find { |r| r.value = "Textfil" }.check
submit_button = form.buttons.find { |b| b.type == "submit" }
response = agent.submit(form, submit_button)

rows = CSV.parse(response.content, :headers => true, :col_sep => "\t")
domains = rows.map { |row| row["Webbadress"] unless row["Namn"] =~ /UNIVERSITET/}

Gman.import("Swedish Administrative Authorities" => domains)

Version data entries

12 entries across 12 versions & 1 rubygems

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