<commit_before>#!/usr/bin/env perl
#
# A set of routines for use in my Perl scripts for Lacuna Expanse.  See the other
# scripts found with this for examples.

use 5.10.0;
use Data::Printer;
use FindBin;
use List::Util            qw(first);
use lib '/home/abaugher/git/Games-Lacuna-Client/lib';  # point to your location
use Games::Lacuna::Client ();
use Games::Lacuna::Client::Types;
use Getopt::Long          qw(GetOptions);
use YAML::Any             qw(LoadFile DumpFile Dump);
use Fcntl qw(:flock);
$|=1;

my $cfg_file = Games::Lacuna::Client->get_config_file(['login.yml', 'lacuna.yml']);
my $client = Games::Lacuna::Client->new(
    cfg_file => $cfg_file,
    # debug    => 1,
);
my $c = load_cache();

my $empire  = $client->empire->get_status->{empire};
my $planets = $empire->{planets};

# Build a timestamp for now
my @gm = gmtime;
$gm[5]+=1900; $gm[4]++;
my $now = sprintf "%04d %02d %02d %02d %02d %02d", @gm[5,4,3,2,1,0];

# Get the basic stats from the server, when nothing else is needed as part of the call.
sub get_stats {
    my $processor = shift;
    my $s = $client->stats->empire_rank();
    return $s;
}

# Get a GLC object.
sub get_client {
    return $client;
}<commit_msg>Minor change to use GLC cfg_file better.<commit_after>#!/usr/bin/env perl
#
# A set of routines for use in my Perl scripts for Lacuna Expanse.  See the other
# scripts found with this for examples.

use 5.10.0;
use Data::Printer;
use FindBin;
use List::Util            qw(first);
# If you've downloaded the latest GLC with git, point to its location:
use lib '/home/abaugher/git/Games-Lacuna-Client/lib';
use Games::Lacuna::Client ();
use Games::Lacuna::Client::Types;
use Getopt::Long          qw(GetOptions);
use YAML::Any             qw(LoadFile DumpFile Dump);
use Fcntl qw(:flock);
$|=1;

my $client = Games::Lacuna::Client->new(
    cfg_file => 'lacuna.yml',
    # debug    => 1,
);
my $c = load_cache();

my $empire  = $client->empire->get_status->{empire};
my $planets = $empire->{planets};

# Build a timestamp for now
my @gm = gmtime;
$gm[5]+=1900; $gm[4]++;
my $now = sprintf "%04d %02d %02d %02d %02d %02d", @gm[5,4,3,2,1,0];

# Get the basic stats from the server, when nothing else is needed as part of the call.
sub get_stats {
    my $processor = shift;
    my $s = $client->stats->empire_rank();
    return $s;
}

# Get a GLC object.
sub get_client {
    return $client;
}
{'fraction_non_alphanumeric': 0.15668202764976957, 'fraction_numerical': 0.025136154168412233, 'mean_word_length': 3.719367588932806, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3409850', 'n_tokens_mistral': 940, 'n_tokens_neox': 891, 'n_words': 272}