<commit_before>package DDG::Spice::Snow;

use DDG::Spice;

spice to => 'http://isitsnowingyet.org/api/check/$1/key/e95fad09aa5091b7734d1a268b53cef5';

triggers query_lc => qr/snow(?:ing)?/i;

my %snow = map { $_ => undef } (
    'is it going to snow',
    'going to snow',
    'going to snow today',
    'is it snowing',
    'is it snowing here',
    'is it snowing now',
    'is it going to snow here',
    'is it snowing today',
    'is it going to snow today',
    'going to snow today',
);


handle query_lc => sub {
    my $query = $_;
    my $location = join(" ", $loc->city . ', ', $loc->region_name . ', ', $loc->country_name);

    if(exists $snow{$query}) {
        return $location;
    } elsif($query =~ /^(?:is[ ]it[ ])?
                        (?:going[ ]to )?
                        snow(?:ing)?[ ]?
                        (?:(?:here|now)[ ]?)?
                        (?:in[ ](.*?))?
                        (?:[ ]today)?\??$/ix) {
        $location = $1 || $location;
        return $location;
    }
    return;
};

1;<commit_msg>Removed API key from the Snow plugin.<commit_after>package DDG::Spice::Snow;

use DDG::Spice;

spice to => 'http://isitsnowingyet.org/api/check/$1/key/{{ENV{DDG_SPICE_SNOW_APIKEY}}}';

triggers query_lc => qr/snow(?:ing)?/i;

my %snow = map { $_ => undef } (
    'is it going to snow',
    'going to snow',
    'going to snow today',
    'is it snowing',
    'is it snowing here',
    'is it snowing now',
    'is it going to snow here',
    'is it snowing today',
    'is it going to snow today',
    'going to snow today',
);


handle query_lc => sub {    
    my $query = $_;
    my $location = join(" ", $loc->city . ', ', $loc->region_name . ', ', $loc->country_name);

    if(exists $snow{$query}) {
        return $location;
    } elsif($query =~ /^(?:is[ ]it[ ])?
                        (?:going[ ]to[ ])?
                        snow(?:ing)?[ ]?
                        (?:(?:here|now)[ ]?)?
                        (?:in[ ](.*?))?
                        (?:[ ]today)?\??$/ix) {
        $location = $1 || $location;
        return $location;
    }
    return;
};

1;
{'fraction_non_alphanumeric': 0.19520225776105363, 'fraction_numerical': 0.011759172154280339, 'mean_word_length': 1.9297520661157024, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '7352298', 'n_tokens_mistral': 780, 'n_tokens_neox': 734, 'n_words': 181}