Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (34 sloc) 0.864 kb
use 5.010;
use strict;
use warnings;
use lib 'lib';
use Autologout qw/schema/;
use autodie;
my $rs = Autologout::schema()->resultset('Site');
open my $in, '<:encoding(UTF-8)', 'data/working.csv';
while (<$in>) {
chomp;
my ($site_name, $logout_url) = split /,/, $_, 2;
$logout_url =~ m{^(https?://[^/]+(?:/|$))};
my $site_url = $1;
$rs->create({
site_name => $site_name,
site_url => $site_url,
logout_url => $logout_url,
protected => 0,
approved => 1,
votes_yes => 1,
});
}
close $in;
open $in, '<:encoding(UTF-8)', 'data/protected.csv';
while (<$in>) {
chomp;
my ($name, $url) = split /,/;
$rs->create({
site_name => $name,
site_url => $url,
protected => 1,
approved => 1,
});
}
Jump to Line
Something went wrong with that request. Please try again.