<commit_before>use 5.010;
use utf8;

package HTTP::Cookies::Chrome;
use strict;

use warnings;
no warnings;

use POSIX;

=head1 NAME

HTTP::Cookies::Chrome - Cookie storage and management for Google Chrome

=head1 SYNOPSIS

	use HTTP::Cookies::Chrome;

	my $cookie_jar = HTTP::Cookies::Chrome->new;
	$cookie_jar->load( $path_to_cookies );

	# otherwise same as HTTP::Cookies

=head1 DESCRIPTION

This package overrides the C<load()> and C<save()> methods of
C<HTTP::Cookies> so it can work with Google Chrome cookie files,
which are SQLite databases.

See L<HTTP::Cookies>.

=head2 The Chrome cookies table

	creation_utc    INTEGER NOT NULL UNIQUE PRIMARY KEY
	host_key        TEXT NOT NULL
	name            TEXT NOT NULL
	value           TEXT NOT NULL
	path            TEXT NOT NULL
	expires_utc     INTEGER NOT NULL
	secure          INTEGER NOT NULL
	httponly        INTEGER NOT NULL
	last_access_utc INTEGER NOT NULL

=head1 SOURCE AVAILABILITY

This module is in Github:

	http://github.com/briandfoy/HTTP-Cookies-Chrome

=head1 AUTHOR

<NAME>, C<< <<EMAIL>> >>

=head1 CREDITS

<NAME> pointed out the problem with dates too far in the future

=head1 COPYRIGHT AND LICENSE

Copyright (c) 2009-2010 <NAME>.  All rights reserved.

This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut


use base qw( HTTP::Cookies );
use vars qw( $VERSION );

use constant TRUE  => 1;
use constant FALSE => 0;

$VERSION = '0.99_01';

use Data::Dumper;
use DBI qw(:sql_types);

sub _dbh { $_[0]->{dbh} }

sub _connect
	{
	my( $self, $file ) = @_;
	my $dbh = DBI->connect( "dbi:SQLite:dbname=$file", '', '' );
	$_[0]->{dbh} = $dbh;
	}
	
sub _get_rows
	{
	my( $self, $file ) = @_;
	
	my $dbh = $self->_connect( $file );
	
	my $sth = $dbh->prepare( 'SELECT * FROM cookies' );

	# Without this, Perl converts the long numbers into
	# scientific notation
	foreach my $column ( 1, 6 .. 9 )
		{
		$sth->bind_col( $column, undef, SQL_INTEGER );
		}<commit_msg>* Bump to development version 0.99_02<commit_after>use 5.010;
use utf8;

package HTTP::Cookies::Chrome;
use strict;

use warnings;
no warnings;

use POSIX;

=head1 NAME

HTTP::Cookies::Chrome - Cookie storage and management for Google Chrome

=head1 SYNOPSIS

	use HTTP::Cookies::Chrome;

	my $cookie_jar = HTTP::Cookies::Chrome->new;
	$cookie_jar->load( $path_to_cookies );

	# otherwise same as HTTP::Cookies

=head1 DESCRIPTION

This package overrides the C<load()> and C<save()> methods of
C<HTTP::Cookies> so it can work with Google Chrome cookie files,
which are SQLite databases.

See L<HTTP::Cookies>.

=head2 The Chrome cookies table

	creation_utc    INTEGER NOT NULL UNIQUE PRIMARY KEY
	host_key        TEXT NOT NULL
	name            TEXT NOT NULL
	value           TEXT NOT NULL
	path            TEXT NOT NULL
	expires_utc     INTEGER NOT NULL
	secure          INTEGER NOT NULL
	httponly        INTEGER NOT NULL
	last_access_utc INTEGER NOT NULL

=head1 SOURCE AVAILABILITY

This module is in Github:

	http://github.com/briandfoy/HTTP-Cookies-Chrome

=head1 AUTHOR

<NAME>, C<< <<EMAIL>> >>

=head1 CREDITS

<NAME> pointed out the problem with dates too far in the future

=head1 COPYRIGHT AND LICENSE

Copyright (c) 2009-2010 <NAME>.  All rights reserved.

This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut


use base qw( HTTP::Cookies );
use vars qw( $VERSION );

use constant TRUE  => 1;
use constant FALSE => 0;

$VERSION = '0.99_02';

use Data::Dumper;
use DBI qw(:sql_types);

sub _dbh { $_[0]->{dbh} }

sub _connect
	{
	my( $self, $file ) = @_;
	my $dbh = DBI->connect( "dbi:SQLite:dbname=$file", '', '' );
	$_[0]->{dbh} = $dbh;
	}
	
sub _get_rows
	{
	my( $self, $file ) = @_;
	
	my $dbh = $self->_connect( $file );
	
	my $sth = $dbh->prepare( 'SELECT * FROM cookies' );

	# Without this, Perl converts the long numbers into
	# scientific notation
	foreach my $column ( 1, 6 .. 9 )
		{
		$sth->bind_col( $column, undef, SQL_INTEGER );
		}
{'fraction_non_alphanumeric': 0.11442786069651742, 'fraction_numerical': 0.017661691542288558, 'mean_word_length': 3.543502824858757, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1012028', 'n_tokens_mistral': 1526, 'n_tokens_neox': 1399, 'n_words': 483}