WWW::Battrick

Check-in [10b4652304]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:dies if no login, fixtures column
Timelines: family | ancestors | descendants | both | develop
Files: files | file ages | folders
SHA1:10b465230468eca6ff48add19baf1cec607ea09d
User & Date: erez.schatz@gmail.com 2011-09-09 14:42:09
Context
2011-09-11
07:23
new result Leaf check-in: a452411654 user: erez.schatz@gmail.com tags: develop
2011-09-09
14:42
dies if no login, fixtures column check-in: 10b4652304 user: erez.schatz@gmail.com tags: develop
12:50
columns check-in: ff1dcd408e user: erez.schatz@gmail.com tags: develop
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to lib/WWW/Battrick/Schema/Result/Fixtures.pm.

1
2
3
4
5









































6
package WWW::Battrick::Schema::Result::Fixtures;
use base 'DBIx::Class::Core';

__PACKAGE__->table('fixtures');










































1;





>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package WWW::Battrick::Schema::Result::Fixtures;
use base 'DBIx::Class::Core';

__PACKAGE__->table('fixtures');


__PACKAGE__->load_components(
    qw/
          TimeStamp
          InflateColumn::DateTime::Duration
      /
  );

__PACKAGE__->add_columns(
    id  => {
        data_type => 'integer',
        is_nullable => 0,
        is_auto_increment => 1,
        default_value => '',
    },
    match_id => {
        data_type => 'integer',
        is_nullable => 0,
    },
    match_date => {
        data_type => 'datetime',
        is_nullable => 0,
    },
    match_type => {
        data_type => 'integer',
        is_nullable => 0,
    },
    friendly => {
        data_type => 'boolean',
        is_nullable => 1,
    },
    rival_id => {
        data_type => 'integer',
        is_nullable => 1,
    },
    venue => {
        data_type => 'string',
        is_nullable => 0,
    },
);

1;

Changes to lib/WWW/Battrick/Site.pm.

17
18
19
20
21
22
23


24
25

26
27
28
29
30
31
32
33
34
35





    $mech->form_id('login');
    $mech->set_fields(
        username => $user,
        password => $password,
    );
    $mech->click;



    foreach my $page (qw/office squad fixtures club finances nets ground/) {
        save_page($page);

    }
}

sub save_page {
    my $page = shift;
    $mech->get( "http://battrick.org/nl/$page.asp" );
    open my $TEMP, '>', $page || die "Error opening $page temp file - $!\n";
    print $TEMP $mech->content;
    close $TEMP;
}












>
>


>










>
>
>
>
>
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
    $mech->form_id('login');
    $mech->set_fields(
        username => $user,
        password => $password,
    );
    $mech->click;

    eval { $mech->get( "http://battrick.org/nl/squad.asp" ) };
    die 'error logging to battrick' if $@;
    foreach my $page (qw/office squad fixtures club finances nets ground/) {
        save_page($page);
        update_data($page);
    }
}

sub save_page {
    my $page = shift;
    $mech->get( "http://battrick.org/nl/$page.asp" );
    open my $TEMP, '>', $page || die "Error opening $page temp file - $!\n";
    print $TEMP $mech->content;
    close $TEMP;
}

sub update_data {
}

1;