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

# ABSTRACT: Get info on teams in the FIRST Robotics Competition

# Start at http://docs.duckduckhack.com/walkthroughs/forum-lookup.html if you are new
# to instant answer development

use DDG::Spice;

# Caching - http://docs.duckduckhack.com/backend-reference/api-reference.html#caching
spice is_cached => 1;
spice proxy_cache_valid => "200 1d"; # defaults to this automatically

spice wrap_jsonp_callback => 1; # only enable for non-JSONP APIs (i.e. no &callback= parameter)

# API endpoint - http://docs.duckduckhack.com/walkthroughs/forum-lookup.html#api-endpoint
spice to => 'https://www.thebluealliance.com/api/v2/team/frc$1?X-TBA-App-Id=frc885:search-engine:1';

# Triggers - https://duck.co/duckduckhack/spice_triggers
triggers any => 'frc team', 'first robotics team';

# Handle statement
handle  => sub {

    return $_ if $_;
    return;
};

1;<commit_msg>Refined the Handle function so it will only accept queries with numerical digits.<commit_after>package DDG::Spice::FirstRoboticsTeams;

# ABSTRACT: Get info on teams in the FIRST Robotics Competition

use DDG::Spice;

spice is_cached => 1;
spice proxy_cache_valid => "200 1d"; # defaults to this automatically

spice wrap_jsonp_callback => 1;

spice to => 'https://www.thebluealliance.com/api/v2/team/frc$1?X-TBA-App-Id=frc885:search-engine:1';

triggers any => 'frc team', 'first robotics team';

handle remainder => sub {
    return unless qr/\d;
};

1;
{'fraction_non_alphanumeric': 0.12593094109681788, 'fraction_numerical': 0.017603249830737983, 'mean_word_length': 4.7734375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 3, 'lorem ipsum': 0, 'www.': 2, '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': '7372996', 'n_tokens_mistral': 549, 'n_tokens_neox': 515, 'n_words': 129}