Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
Fixing missing "return;" and general cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Getty committed Apr 25, 2012
1 parent bb8bf1e commit 1b101b8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
1 change: 0 additions & 1 deletion lib/DDG/Spice/Bible.pm
Expand Up @@ -12,6 +12,5 @@ handle query_lc => sub {
}
return;
};
# $is_kill_pre_results = 1;

1;
2 changes: 1 addition & 1 deletion lib/DDG/Spice/FlashVersion.pm
Expand Up @@ -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;
12 changes: 7 additions & 5 deletions lib/DDG/Spice/RandWord.pm
Expand Up @@ -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;
3 changes: 2 additions & 1 deletion lib/DDG/Spice/Twitter.pm
Expand Up @@ -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;
15 changes: 8 additions & 7 deletions lib/DDG/Spice/Xkcd.pm
Expand Up @@ -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;
Expand All @@ -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;

0 comments on commit 1b101b8

Please sign in to comment.