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

use DDG::Spice;

triggers startend => "hn", "hackernews", "hacker news", "news.yc", "news.ycombinator.com", "hn search";

spice to => 'http://api.thriftdb.com/api.hnsearch.com/items/_search?q=$1&limit=50&weights[title]=1.1&weights[text]=0.7&weights[domain]=2.0&weights[username]=0.1&weights[type]=0.0&weights[points]=1.25&boosts[fields][points]=0.15&boosts[fields][num_comments]=0.15&boosts[functions][pow%282,div%28div%28ms%28create_ts,NOW%29,3600000%29,72%29%29]=200.0&callback={{callback}}';

handle remainder => sub {
    return $_;
};

1;<commit_msg>fixed small bug in hacker news, added a few more triggers<commit_after>package DDG::Spice::HackerNews;

use DDG::Spice;

triggers startend => "hn", "hackernews", "hacker news", "news.yc", "news.ycombinator.com", "hn search", "hnsearch", "hacker news search", "hackernews search";

spice to => 'http://api.thriftdb.com/api.hnsearch.com/items/_search?q=$1&limit=50&weights[title]=1.1&weights[text]=0.7&weights[domain]=2.0&weights[username]=0.1&weights[type]=0.0&weights[points]=1.25&boosts[fields][points]=0.15&boosts[fields][num_comments]=0.15&boosts[functions][pow%282,div%28div%28ms%28create_ts,NOW%29,3600000%29,72%29%29]=200.0&callback={{callback}}';

handle remainder => sub {
    return $_ if defined $_;
};

1;
{'fraction_non_alphanumeric': 0.20697498104624715, 'fraction_numerical': 0.0803639120545868, 'mean_word_length': 8.850746268656716, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '2615837', 'n_tokens_mistral': 557, 'n_tokens_neox': 507, 'n_words': 61}