<commit_before>package DDG::Spice::Astrobin::Apod;
# ABSTRACT: Fetch Astronomy picture of day.

use strict;
use DDG::Spice;

triggers start => "astronomy", "astrophoto";

spice to => 'http://www.astrobin.com/api/v1/imageoftheday/?limit=1&api_key={{ENV{DDG_SPICE_ASTROBIN_APIKEY}}}&api_secret={{ENV{DDG_SPICE_ASTROBIN_APISECRET}}}&format=json$1';
spice proxy_cache_valid => "200 60m";
spice wrap_jsonp_callback => 1;

spice alt_to => {
	fetch_id => {
		to => 'http://www.astrobin.com/api/v1/image/$1/?api_key={{ENV{DDG_SPICE_ASTROBIN_APIKEY}}}&api_secret={{ENV{DDG_SPICE_ASTROBIN_APISECRET}}}&format=json',
		wrap_jsonp_callback => 1
	}
};

handle remainder => sub {
        return '' if /^((image|photo|picture)s?)?\s*(of|of the)?\s*(day|today|daily)$/i;
        return;
};
1;<commit_msg>Added "apod" as trigger #2582<commit_after>package DDG::Spice::Astrobin::Apod;
# ABSTRACT: Fetch Astronomy picture of day.

use strict;
use DDG::Spice;

triggers start => "astronomy", "astrophoto", "apod";

spice to => 'http://www.astrobin.com/api/v1/imageoftheday/?limit=1&api_key={{ENV{DDG_SPICE_ASTROBIN_APIKEY}}}&api_secret={{ENV{DDG_SPICE_ASTROBIN_APISECRET}}}&format=json$1';
spice proxy_cache_valid => "200 60m";
spice wrap_jsonp_callback => 1;

spice alt_to => {
	fetch_id => {
		to => 'http://www.astrobin.com/api/v1/image/$1/?api_key={{ENV{DDG_SPICE_ASTROBIN_APIKEY}}}&api_secret={{ENV{DDG_SPICE_ASTROBIN_APISECRET}}}&format=json',
		wrap_jsonp_callback => 1
	}
};

handle remainder => sub {
        return '' if /^((image|photo|picture)s?)?\s*(of|of the)?\s*(day|today|daily)$/i;
        return;
};
1;
{'fraction_non_alphanumeric': 0.1875, 'fraction_numerical': 0.01875, 'mean_word_length': 6.277272727272727, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '4487558', 'n_tokens_mistral': 686, 'n_tokens_neox': 670, 'n_words': 88}