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

use DDG::Spice;

spice is_cached => 0;

# false positive: scrounges up
# in response forcing is, but may want to only check for is if no domain extension
triggers query_lc => qr/^(?:is\s)([0-9a-z\-]+)(?:(\.[a-z]{2,4})|)\s(?:up|down|working)/;

spice to => 'http://isitup.org/$1.json?callback={{callback}}';

handle matches => sub {
    return $2 ? $1.$2 : $1.'.com';
    return;
};

1;
<commit_msg>fix false positives for isitup<commit_after>package DDG::Spice::IsItUp;

use DDG::Spice;

spice is_cached => 0;

triggers query_lc => qr/^((?:is\s|))([0-9a-z\-]+)(?:(\.[a-z]{2,4})|)\s(?:up|down|working)/;

spice to => 'http://isitup.org/$1.json?callback={{callback}}';

handle matches => sub {
    return $1 ? ($3 ? $2.$3 : $2.'.com') : $2;
    return;
};

1;

{'fraction_non_alphanumeric': 0.24812967581047382, 'fraction_numerical': 0.029925187032418952, 'mean_word_length': 4.114649681528663, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6851669', 'n_tokens_mistral': 344, 'n_tokens_neox': 337, 'n_words': 70}