duckduckgo / zeroclickinfo-spice

DuckDuckGo Instant Answers based on JavaScript (JSON) APIs
https://duckduckhack.com/
Other
548 stars 942 forks source link

Make sure spice triggers can be before and after query term #125

Closed jagtalon closed 11 years ago

jagtalon commented 11 years ago

Noticed that Reddit only allows subreddit <term> and not <term> subreddit, for the simple ones we should make sure you can trigger the spice either way.

https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/RedditSubSearch.pm

Really we should move as many spice plugins as we can over to "word triggers" and use a regex to qualify them. Hence we no longer have this issue.

jagtalon commented 11 years ago

@moollaza I think the Reddit plugin already allows both: https://duckduckgo.com/?q=reddit+dog https://duckduckgo.com/?q=dog+reddit

moollaza commented 11 years ago

Yup you're right. Good catch, it was actually RedditSubSearch. I updated the link above.

jagtalon commented 11 years ago

Fixed in https://github.com/duckduckgo/zeroclickinfo-spice/commit/81042c662f4fe88a38b0c8da09000bc183d222e1. Not yet in word-trigger form, but it will do for now.