diff --git a/lib/DDG/Spice/Bible.pm b/lib/DDG/Spice/Bible.pm index b86e440244..b36ee93859 100644 --- a/lib/DDG/Spice/Bible.pm +++ b/lib/DDG/Spice/Bible.pm @@ -12,6 +12,5 @@ handle query_lc => sub { } return; }; -# $is_kill_pre_results = 1; 1; diff --git a/lib/DDG/Spice/FlashVersion.pm b/lib/DDG/Spice/FlashVersion.pm index 88d4940234..faeb5ee0a0 100644 --- a/lib/DDG/Spice/FlashVersion.pm +++ b/lib/DDG/Spice/FlashVersion.pm @@ -7,7 +7,7 @@ triggers startend => "flash"; spice call_type => 'self'; handle query_lc => sub { - return call if ($_ eq 'flash version'); + return $_ eq 'flash version' ? call : (); }; 1; diff --git a/lib/DDG/Spice/RandWord.pm b/lib/DDG/Spice/RandWord.pm index 735fd7409f..a6a389e655 100644 --- a/lib/DDG/Spice/RandWord.pm +++ b/lib/DDG/Spice/RandWord.pm @@ -18,14 +18,16 @@ __END_OF_CONF__ } triggers any => "random", "word"; + handle query_lc => sub { if ($_ =~ /^random word(?: ([0-9]+\-[0-9]+)|)$/) { - if ($1) { - return $1; - } else { - return call; - } + if ($1) { + return $1; + } else { + return call; + } } return; }; + 1; diff --git a/lib/DDG/Spice/Twitter.pm b/lib/DDG/Spice/Twitter.pm index a70dc4afe3..32e9c4adc7 100644 --- a/lib/DDG/Spice/Twitter.pm +++ b/lib/DDG/Spice/Twitter.pm @@ -5,10 +5,11 @@ use DDG::Spice; spice to => 'http://twitter.com/status/user_timeline/$1.json?callback={{callback}}'; triggers query_lc => qr/^@([^\s]+)$/; + handle matches => sub { my $uname = $_ || ''; return $uname if $uname; return; -# $is_kill_pre_results = 1; }; + 1; diff --git a/lib/DDG/Spice/Xkcd.pm b/lib/DDG/Spice/Xkcd.pm index f7f0bb0f90..6a14bfc8c8 100644 --- a/lib/DDG/Spice/Xkcd.pm +++ b/lib/DDG/Spice/Xkcd.pm @@ -5,7 +5,8 @@ use DDG::Spice; triggers startend => "xkcd"; sub nginx_conf { - $nginx_conf = <<"__END_OF_CONF__"; + $nginx_conf = <<"__END_OF_CONF__"; + location ^~ /js/spice/xkcd/ { echo_before_body 'ddg_spice_xkcd('; rewrite ^/js/spice/xkcd/(.*) /api-0/jsonp/comic/\$1 break; @@ -16,15 +17,15 @@ location ^~ /js/spice/xkcd/ { __END_OF_CONF__ } - handle query_lc => sub { if ($_ eq 'xkcd' || $_ =~ /^xkcd (\d+)$/) { - if ($1) { - return $1; - } else { - return call; - } + if ($1) { + return $1; + } else { + return call; + } } + return; }; 1;