WWW::Battrick

Check-in [efd7e36937]
Login

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

Overview
Comment:first fossil commit
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:efd7e36937ba1b8680ad45b089dc3fe13b3488aa
User & Date: erez 2011-10-30 17:10:40
Context
2011-10-30
17:11
merge from develop and added parser beta check-in: 56409e72c9 user: erez tags: trunk
17:10
first fossil commit check-in: efd7e36937 user: erez tags: trunk
2011-09-07
15:24
schemas check-in: d7a06f8d00 user: erezs@teleweb.co.il tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to bin/battrick.

1
2
3
4
5
6
7




8
#!/usr/bin/perl

use strict;
use warnings;

use WWW::Battrick;





WWW::Battrick::run();







>
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/perl

use strict;
use warnings;

use WWW::Battrick;

print "Username: ";
chomp (my $user = <STDIN>);
print "Password: ";
chomp (my $pass = <STDIN>);
WWW::Battrick::run($user, $pass);

Changes to lib/WWW/Battrick.pm.

1
2
3
4






























5


6
7
use strict;
use warnings;
package WWW::Battrick;































sub run {


}
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


package WWW::Battrick;

use WWW::Battrick::Schema;
use WWW::Battrick::Site;
use Moose;

has schema => (
    is => 'ro',
    isa => 'DBIx::Class::Schema',
    lazy_build => 1,
);

sub _build_schema {
    my $self = shift;

    unless (opendir my $DIR, "$ENV{HOME}/.battrick") {
        mkdir "$ENV{HOME}/.battrick";
    }

    my $schema = WWW::Battrick::Schema->connect(
        "dbi:SQLite:$ENV{HOME}/.battrick/data.db"
    );

    eval {
        $schema->resultset('Player')->search->all;
    };
    $schema->deploy if $@;

    return $schema;
}


sub run {
    my ($user, $pass) = @_;
    WWW::Battrick::Site::login($user, $pass);
}
1;

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

1
2
3


4
package WWW::Battrick::Schema::Result::Finances;
use base 'DBIx::Class::Core';



1;



>
>

1
2
3
4
5
6
package WWW::Battrick::Schema::Result::Finances;
use base 'DBIx::Class::Core';

__PACKAGE__->table('finances');

1;

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

1
2
3











































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












































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/Schema/Result/Ground.pm.

1
2
3


4
package WWW::Battrick::Schema::Result::Ground;
use base 'DBIx::Class::Core';



1;



>
>

1
2
3
4
5
6
package WWW::Battrick::Schema::Result::Ground;
use base 'DBIx::Class::Core';

__PACKAGE__->table('ground');

1;