Permalink
Browse files

Switched Xkcd to handle remainder

  • Loading branch information...
1 parent 446b5f5 commit 64504053cf5fbcb4db76657666e2c895b0fee4f2 @moollaza moollaza committed Mar 25, 2013
Showing with 9 additions and 8 deletions.
  1. +9 −8 lib/DDG/Spice/Xkcd.pm
View
@@ -23,14 +23,15 @@ spice wrap_jsonp_callback => 1;
spice is_cached => 0;
-handle query_lc => sub {
- s/ ?xkcd ?//;
- if ($_ =~ /^(\d+|r(?:andom)?)$/) {
- return int rand 1122 if $1 =~ /r/;
- return $1;
- }
- return '' if $_ eq '';
- return;
+handle remainder => sub {
+
+ if ($_ =~ /^(\d+|r(?:andom)?)$/) {
+ return int rand 1122 if $1 =~ /r/;
+ return $1;
+ }
+
+ return '' if $_ eq '';
+ return;
};
1;

0 comments on commit 6450405

Please sign in to comment.