Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 37 lines (34 sloc) 0.864 kb
b331a53 @moritz start putting stuff into a DB
authored
1 use 5.010;
2 use strict;
3 use warnings;
4 use lib 'lib';
5 use Autologout qw/schema/;
6 use autodie;
7
8 my $rs = Autologout::schema()->resultset('Site');
9 open my $in, '<:encoding(UTF-8)', 'data/working.csv';
10 while (<$in>) {
11 chomp;
12 my ($site_name, $logout_url) = split /,/, $_, 2;
13 $logout_url =~ m{^(https?://[^/]+(?:/|$))};
14 my $site_url = $1;
15 $rs->create({
16 site_name => $site_name,
17 site_url => $site_url,
18 logout_url => $logout_url,
19 protected => 0,
20 approved => 1,
21 votes_yes => 1,
22 });
23 }
24 close $in;
25 open $in, '<:encoding(UTF-8)', 'data/protected.csv';
26 while (<$in>) {
27 chomp;
28 my ($name, $url) = split /,/;
29 $rs->create({
30 site_name => $name,
31 site_url => $url,
32 protected => 1,
33 approved => 1,
34 });
35 }
36
Something went wrong with that request. Please try again.