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

Brainy Quote: Rename template #569

Closed
wants to merge 543 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
543 commits
Select commit Hold shift + click to select a range
00775b4
removed/renamed rhymes template
russellholt Apr 8, 2014
396f14c
Merge pull request #500 from duckduckgo/brian/bttf-pass-searchterm-im…
bsstoner Apr 8, 2014
406d502
sound_cloud.js: make it partially work on bttf.
Apr 8, 2014
9033a35
CSS ids
russellholt Apr 8, 2014
ed4199c
Merge pull request #504 from duckduckgo/jag/bttfbeta/carousel
russellholt Apr 8, 2014
19cdd44
tighten up dictionary relevancy
russellholt Apr 8, 2014
894b7f7
xkcd - id, formatting, item
russellholt Apr 8, 2014
ae1ec90
xkcd template rename
russellholt Apr 9, 2014
df78ee8
xkcd display name
russellholt Apr 9, 2014
7dd091b
Merge branch 'russell/bttf-helpers2' into bttf-beta
russellholt Apr 9, 2014
fa73d8d
alternative_to: initial port to BTTF. :cake:
Apr 9, 2014
8d85774
alternative_to.handlebars: added the number of likes below the title.
Apr 9, 2014
d5d8746
alternative_to: add platforms.
Apr 9, 2014
8f1f603
alternative_to: replace "in_theaters" to "alternative_to"
Apr 9, 2014
1748d86
Merge remote-tracking branch 'origin/bttf-beta' into jag/bttf/alterna…
Apr 9, 2014
f55fc4b
alternative_to.js: Fix the searchTerm
Apr 9, 2014
888897a
movie.js: initial port to bttf
Apr 9, 2014
0c277c8
drinks - make functional
russellholt Apr 9, 2014
e6bea63
delete/rename
russellholt Apr 9, 2014
f356c24
alternative_to.js: removed the `total` attribute.
Apr 9, 2014
79396fc
alternative_to.js: modify normalize.
Apr 9, 2014
cc5fcc8
congress: from tabs to spaces
jdorweiler Apr 9, 2014
6fc95ab
movie.js: almost working prototype. needs relevancy
Apr 9, 2014
fd866ad
Changed the height of the tiles in movie and in_theaters.
Apr 9, 2014
810f8e7
CSS changes in movie and in_theaters.
Apr 9, 2014
3061da1
movie.js: added relevancy.
Apr 9, 2014
0c98620
movie.js: add a check for critics_score.
Apr 9, 2014
d5ee7d7
Fixed the normalize function.
Apr 9, 2014
ea9e2fa
Merge pull request #507 from jdorweiler/jd-congress
Apr 9, 2014
0f1bf61
brainy_quote.js: start porting to bttf.
Apr 9, 2014
6162ab3
brainy_quote.js: Made it work for bttf.
Apr 9, 2014
fb6f2d2
brainy_quote: remove the one-line class from the template.
Apr 9, 2014
79b83cd
different data structure for mobile
Apr 10, 2014
a5af975
put the temp bar scaling data back
Apr 10, 2014
31c4f16
Merge pull request #508 from duckduckgo/jag/bttf/rotten
russellholt Apr 10, 2014
3b4733f
Merge pull request #506 from duckduckgo/jag/bttf/alternativeto
russellholt Apr 10, 2014
ee71745
Merge pull request #510 from duckduckgo/jag/bttf/quotes
russellholt Apr 10, 2014
9ce3f4b
mobile adjustments/styling for forecast
Apr 10, 2014
e40f527
mobile refinements for forecast
Apr 10, 2014
3540fc5
Merge pull request #511 from duckduckgo/doug/bttf-forecast-mobile
bsstoner Apr 10, 2014
0c0d808
CSS changes to InTheaters and Movie.
Apr 10, 2014
43c561e
ruby: started api conversion
Apr 10, 2014
030e197
movie.css: decrease white space
Apr 10, 2014
de22efc
airlines: sorta
russellholt Apr 10, 2014
a91d23d
more mobile forecast refinements
Apr 10, 2014
6367698
airlines: mutiple flights
Apr 10, 2014
fbb6dfa
airlines: clean up and comments
Apr 10, 2014
db76e44
amazon: update for rating change
russellholt Apr 10, 2014
486fd3c
Merge pull request #513 from duckduckgo/jd/airlines
russellholt Apr 10, 2014
d9d2fed
GitHub: Port GitHub to BTTF.
Apr 11, 2014
b4025af
lastfm_artist.js: Initial port to BTTf.
Apr 11, 2014
23946ca
lastfm_artist: First working prototype
Apr 11, 2014
34eadef
lastfm_artist: Add top songs.
Apr 11, 2014
fe959e2
github_jobs: remove console.log.
Apr 11, 2014
e93eb5d
mobile adjustment for recipes
Apr 11, 2014
e391f69
Merge pull request #518 from duckduckgo/jag/bttf/lastfm
russellholt Apr 11, 2014
94850f1
Merge pull request #516 from duckduckgo/jag/bttf/github-jobs
russellholt Apr 11, 2014
996cd27
Weather: reign in trigger by making start end.
nilnilnil Apr 11, 2014
913c39f
urbanDictionary: update api
Apr 12, 2014
45f4529
ubranDictionary: update detail
Apr 12, 2014
d89be08
update to recipes to use new builtin template
russellholt Apr 14, 2014
d031860
Merge branch 'jd/rbjems' into bttf-beta
russellholt Apr 14, 2014
b332cde
Merge branch 'jd-congress' into bttf-beta
russellholt Apr 14, 2014
0c6679c
Merge pull request #502 from duckduckgo/jd-congress
russellholt Apr 14, 2014
019a14b
don't hard code view for forecast, it switches for mobile, fixes #116…
bsstoner Apr 14, 2014
7335f6a
metaCPAN: update api
Apr 14, 2014
d2b6b45
UrbanDict: removed moreAt
Apr 14, 2014
a7b3065
PLOS: update api
Apr 14, 2014
bd13f74
PLOS: list format
Apr 14, 2014
5e88ad0
t/Forecast.t: disable tests that break unless the trigger is an 'any'…
nilnilnil Apr 14, 2014
e601897
Merge branch 'bttf' into brian/bttf-dont-hard-code-view-for-forecast
bsstoner Apr 14, 2014
4772c2c
Merge pull request #521 from duckduckgo/brian/bttf-dont-hard-code-vie…
bsstoner Apr 14, 2014
1fcfd0c
haxelib: update api
Apr 14, 2014
8ae5b34
haxelib: added icon
Apr 14, 2014
b33257d
Merge pull request #520 from duckduckgo/jd/urban
russellholt Apr 14, 2014
123c888
update new template name
russellholt Apr 14, 2014
a4aa6e4
thesaurus: update api
Apr 14, 2014
5fcf93c
Merge pull request #515 from duckduckgo/russell/bttf-rating
russellholt Apr 14, 2014
4cbf79f
CNorris: updated
Apr 14, 2014
4f0967f
expandURL: updated api
Apr 14, 2014
cc0474e
haxelib: removed favicon
Apr 14, 2014
27074d3
Expatistan: update api
Apr 14, 2014
54f3315
expatistan: clean up
Apr 14, 2014
8deade2
expatistan: clean up
Apr 14, 2014
58476a2
Merge pull request #522 from duckduckgo/jd/metacpan
russellholt Apr 15, 2014
0dd0ec9
built-in template identified by strings, total custom tiles by custom…
russellholt Apr 15, 2014
cabe764
Merge pull request #524 from duckduckgo/jd/haxelib
russellholt Apr 15, 2014
1a90d12
Merge pull request #525 from duckduckgo/jd/thesaurus
russellholt Apr 15, 2014
38951d5
Merge pull request #528 from duckduckgo/jd/expand
russellholt Apr 15, 2014
214f166
Merge pull request #526 from duckduckgo/jd/chucknorris
russellholt Apr 15, 2014
1988aad
congress: deleted leftover merge error
russellholt Apr 15, 2014
c8a8f3b
removed li
russellholt Apr 15, 2014
7256d6e
use string for specifying built-in
russellholt Apr 15, 2014
b43caf9
forecast: using 'custom_item' now instead of 'item'
russellholt Apr 15, 2014
faf36c0
plos: change to div
Apr 15, 2014
a2a5a53
plos: remove debug
Apr 15, 2014
9d56c22
expatistan: source url
Apr 15, 2014
98a94c0
congress: broken link
Apr 15, 2014
8e2453b
is_it_up: update api
Apr 15, 2014
37cef88
wordMap: update api
Apr 15, 2014
078e3a8
hayoo: update api
Apr 15, 2014
507a185
hayoo: results check works
Apr 15, 2014
406487f
redditSubSearch: update api
Apr 15, 2014
c3cb06e
in_theaters: Now using the new standard template.
Apr 15, 2014
d3fdf5f
in_theaters.js: Add the class "opt" to the title and ratings.
Apr 15, 2014
fa19763
in_theaters: Darken the detail view.
Apr 15, 2014
6c936ac
in_theaters: hide both title and stars.
Apr 15, 2014
e078368
movie: added CSS from in_theaters
Apr 16, 2014
dacd1c8
congress: twitter and facebook on new line
Apr 16, 2014
2e5589d
congress: remove debug
Apr 16, 2014
820826c
Merge pull request #527 from duckduckgo/russell/bttf-recipes
russellholt Apr 16, 2014
d121b8d
rename
russellholt Apr 16, 2014
5a0ce3b
height for new std template
russellholt Apr 16, 2014
683c6f2
meta block, normalize function, using basic_image_detail for wrap_detail
russellholt Apr 16, 2014
509cd91
quoted words for standard templates
russellholt Apr 16, 2014
a167511
meta block
russellholt Apr 16, 2014
f675f3a
meta block
russellholt Apr 16, 2014
dd4f4ab
detail_custom
russellholt Apr 16, 2014
ecc2182
rename template
russellholt Apr 16, 2014
305a803
Merge branch 'russell/bttf-recipes' into bttf-beta
russellholt Apr 16, 2014
e033c25
Merge pull request #530 from duckduckgo/russell/bttf-spiceopt
russellholt Apr 16, 2014
3aa1f77
console
russellholt Apr 16, 2014
b43202d
quixey: use quoted built-in templates
russellholt Apr 16, 2014
eb8ec68
octopart - using quote built-in template names
russellholt Apr 16, 2014
19dd3b6
Merge pull request #512 from duckduckgo/jag/bttf/movies-comments
russellholt Apr 16, 2014
3874e30
Merge pull request #523 from duckduckgo/jd/plos
russellholt Apr 16, 2014
e647be7
Merge pull request #531 from duckduckgo/jd/congress
russellholt Apr 16, 2014
48869e9
Merge pull request #532 from duckduckgo/jd/isitup
russellholt Apr 16, 2014
cf0b419
Merge pull request #534 from duckduckgo/jd/hayoo
russellholt Apr 16, 2014
0f95101
Merge pull request #529 from duckduckgo/jd/expatisan
russellholt Apr 16, 2014
cfc6397
Merge pull request #535 from duckduckgo/jd/redditSub
russellholt Apr 16, 2014
8440350
movie.css: Added the dark gray background.
Apr 16, 2014
8bedf66
Merge branch 'bttf-beta' into jag/bttf/in_theaters_std
Apr 16, 2014
3c7cb51
in_theaters.js: now using the short name of the template.
Apr 16, 2014
facc2c6
in_theaters.js: Will now say, "Showing 12 Movies"
Apr 16, 2014
54634ce
in_theaters.js: remove checking for the movies array.
Apr 16, 2014
9b40cbb
Merge branch 'bttf-beta' into jag/bttf/movies_std
Apr 16, 2014
cdfbefb
updates to mobile recipes detail pane
Apr 16, 2014
1da889b
lastfm_artist.js: Initial conversion to the standard template.
Apr 16, 2014
aa91e83
Merge pull request #537 from duckduckgo/jag/bttf/movies_std
russellholt Apr 16, 2014
5a60fd9
quote std template
russellholt Apr 16, 2014
f80ed19
Merge pull request #536 from duckduckgo/jag/bttf/in_theaters_std
russellholt Apr 16, 2014
dd7d7a9
lastfm_artist: completely move to the standard template.
Apr 16, 2014
7e5ea7f
forecast: disable custom_item for now
russellholt Apr 16, 2014
c645929
Merge pull request #539 from duckduckgo/jag/bttf/lastfm_std
russellholt Apr 16, 2014
346efb2
alternative_to: started moving to a standard template.
Apr 16, 2014
a3254a7
word map: favicon link
Apr 16, 2014
b2be92d
alternative_to: Now looks a lot like the mockup.
Apr 16, 2014
1a3c4c6
alternative_to: remove the detail view and add a link.
Apr 16, 2014
c879b08
word map: removed wrap_detail
Apr 16, 2014
a5a46d7
alternative_to: show what platform the software runs on.
Apr 16, 2014
33c8062
alternative_to: The query is already in the API result.
Apr 16, 2014
c962936
github: update api
Apr 16, 2014
e7e0148
github: update api
Apr 16, 2014
54ae0b9
github: name
Apr 16, 2014
1d9f388
github: changed template
Apr 16, 2014
9712421
github: check for description
Apr 16, 2014
3e60eaf
reddit search: update api
Apr 16, 2014
af4c29c
DDG::Spice::Maps::Places: disable caching.
nilnilnil Apr 17, 2014
ac797a6
t/Places.pm: update places test to reflect cache changes.
nilnilnil Apr 17, 2014
c459dfa
rand_word name
russellholt Apr 17, 2014
5eb736c
removed item
russellholt Apr 17, 2014
7d9a984
Merge pull request #540 from duckduckgo/jag/bttf/alternative_to
russellholt Apr 17, 2014
7e55502
minor fix for mobile recipes detail when no cooking time is available
Apr 17, 2014
c37d5d6
github: remove detail
Apr 17, 2014
d91968c
github minor changes - remove css
russellholt Apr 17, 2014
7c56422
change item type wording
russellholt Apr 17, 2014
a89e141
betterific: started api update
Apr 17, 2014
20a9eef
betterific: update api
Apr 17, 2014
cf5f012
betterific: update css
Apr 17, 2014
3d74823
hacker_news.js: change from item to item_custom.
Apr 18, 2014
64a5eb7
Merge pull request #547 from duckduckgo/jag/hacker_news/item_custom
russellholt Apr 18, 2014
ef142b8
airlines: change to use a new template.
Apr 18, 2014
9192f35
Merge pull request #533 from duckduckgo/jd/wordMap
russellholt Apr 18, 2014
c160d8f
Merge pull request #543 from duckduckgo/jd/reddit_search
russellholt Apr 18, 2014
eb58104
Merge pull request #542 from duckduckgo/jd/github
russellholt Apr 18, 2014
086a33f
Merge pull request #545 from duckduckgo/jd/betterific
russellholt Apr 18, 2014
3f6a127
airlines.handlebars: don't show the whole airport name.
Apr 18, 2014
bb2682b
airlines: Print N/A if we don't have the gate or the terminal
Apr 18, 2014
238018c
airlines.js: reversed the array result.
Apr 18, 2014
10b7205
Merge pull request #548 from duckduckgo/jag/bttf/airlines
russellholt Apr 18, 2014
8b1bacc
meta block
russellholt Apr 20, 2014
ca8f0d0
adjusted data object
russellholt Apr 20, 2014
0bca762
changed {{domain}} to {{this.domain}} due to conflict with helper fn
russellholt Apr 20, 2014
67aa598
renamed api_result
russellholt Apr 20, 2014
8a1997b
changed to h3
russellholt Apr 20, 2014
1a20959
id, meta block, helpers
russellholt Apr 20, 2014
fd0fc03
helper names in template
russellholt Apr 20, 2014
8464eb7
chuck norris: changed more at link
Apr 20, 2014
5771328
twitter- using built-in image detail template, but tweet image ebeddi…
russellholt Apr 20, 2014
ceac66f
twitter- added test data, removed irrelevant css file
russellholt Apr 20, 2014
b0e517c
Merge pull request #550 from duckduckgo/jd/norris
russellholt Apr 20, 2014
f5d4ffd
congress: phone on new line
Apr 20, 2014
79e8f71
brainy_quote: Removed extra </div> and the normalize function.
Apr 21, 2014
5dacc12
Flash Version: Move from YUI to FlashDetect.
Apr 21, 2014
54bfc1d
Flash Version: Add a period at the end.
Apr 21, 2014
fb7cdf6
github_jobs: change from `item` to `item_custom`
Apr 21, 2014
28bcadf
Remove movie_item.handlebars
Apr 21, 2014
57c7da5
Movie: Forgot to add `movie_detail.handlebars`
Apr 21, 2014
6f0494f
alternative_to: forgot to add in alternative_to.css
Apr 21, 2014
4c31cde
AlternativeTo: rename template
Apr 21, 2014
db9aa99
in_theaters: remove in_theaters.handlebars
Apr 21, 2014
bafad1c
lastfm: rename templates
Apr 21, 2014
af08074
airlines: rename temlate
Apr 21, 2014
26d8038
brainy_quote: rename template
Apr 21, 2014
746fe5b
hacker_news: rename template
Apr 21, 2014
b4daf40
Merge pull request #557 from duckduckgo/jag/bttf/alternative-to-fix
russellholt Apr 21, 2014
8c2b084
Merge pull request #558 from duckduckgo/jag/bttf/rename
russellholt Apr 21, 2014
31103ba
hacker_news.css: remove the height of the tile
Apr 21, 2014
688e874
Merge pull request #559 from duckduckgo/jag/bttf/hackernews
russellholt Apr 21, 2014
ec17d69
Merge pull request #556 from duckduckgo/jag/bttf/movie-fix
russellholt Apr 21, 2014
133cf0a
Merge pull request #555 from duckduckgo/jag/bttf/jobs
russellholt Apr 21, 2014
aec7ec3
Merge branch 'bttf-beta' into jag/bttf/brainy
Apr 21, 2014
aa736ca
flash_version: remove `item` field and rename the template
Apr 21, 2014
a59f212
Merge pull request #551 from duckduckgo/jd/congress
russellholt Apr 21, 2014
3b869b9
Merge pull request #549 from duckduckgo/russell/bttf-conv
russellholt Apr 21, 2014
49e4413
Merge pull request #552 from duckduckgo/jag/bttf/brainy
russellholt Apr 21, 2014
4b2fca8
hackage_packages: Started moving to the new Spice API.
Apr 21, 2014
e3cec36
hackage_packages: completely moved to the new Spice API.
Apr 21, 2014
3ddbbfe
kwixer: initial port to BTTF.
Apr 21, 2014
16f1f63
kwixer.js: added most of the functionality.
Apr 21, 2014
3b822c1
Kwixer: Ported to BTTF.
Apr 22, 2014
78ff563
bootic: initial port to bttf.
Apr 22, 2014
08502ee
NPM - update for BTTF
moollaza Apr 22, 2014
2308d8e
renamed template to item.handlebars
moollaza Apr 22, 2014
ee0edcf
bootic: ported to BTTF.
Apr 22, 2014
575cbcc
bootic.js: removed the old code
Apr 22, 2014
f27809a
Movie.js: Move the helper function outside.
Apr 22, 2014
d89359a
Flash Version: Rename the template.
Apr 22, 2014
27963bb
bootic.js: Fixed the `itemType`
Apr 22, 2014
5dc5b9a
kwixer: removed unused css files and add an image.
Apr 22, 2014
59392e3
Merge pull request #564 from duckduckgo/jag/bttf/movie-helper
russellholt Apr 22, 2014
de36014
bootic.js: removed the string "Bootic".
Apr 22, 2014
cab2c70
kwixer.css: removed font-family from css
Apr 22, 2014
f5874d1
kwixer.css: removed more stuff that's unused.
Apr 22, 2014
b42ff5d
npm: proper name for template
moollaza Apr 22, 2014
5673516
bootic.js: add `rating: "Unrated"` to disable the rating stars.
Apr 22, 2014
b87b988
Merge pull request #563 from duckduckgo/jag/bttf/bootic
Apr 22, 2014
aca0395
flash_version: rename template
Apr 22, 2014
0b498eb
Merge pull request #554 from duckduckgo/jag/bttf/flash
Apr 22, 2014
27f04b1
Merge branch 'bttf' into bttf-beta
Apr 22, 2014
ae93704
hackage_packages: remove the normalize function.
Apr 22, 2014
edfdcf4
hackage_packages: remove commented code
Apr 22, 2014
c1f8698
npm: force lowercase package name, npm packages don't use capitals
moollaza Apr 22, 2014
9c3e1d9
Merge pull request #565 from duckduckgo/zaahir/bttf/npm
Apr 22, 2014
46a94b0
kwixer.js: add "Unrated" in `rating`.
Apr 22, 2014
c6088e0
Merge pull request #562 from duckduckgo/jag/bttf/kwixer
russellholt Apr 22, 2014
eb3976f
hackage: rename template to details
Apr 22, 2014
7cff677
Merge pull request #561 from duckduckgo/jag/bttf/hackage
russellholt Apr 22, 2014
5aa3737
brainy_quote: renamed template
Apr 22, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/DDG/Spice/Amazon.pm
Expand Up @@ -2,7 +2,7 @@ package DDG::Spice::Amazon;

use DDG::Spice;

spice to => 'https://duckduckgo.com/m.js?q=$1&cb=ddg_spice_amazon';
spice to => 'https://127.0.0.1/m.js?q=$1&cb=ddg_spice_amazon';

triggers start => '///***never trigger***///';

Expand Down
2 changes: 1 addition & 1 deletion lib/DDG/Spice/Congress.pm
Expand Up @@ -12,7 +12,7 @@ source "Sunlight Foundation";
code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/Congress.pm";
topics "special_interest", "trivia";
category "facts";
attribution web => ['http://kevinschaul.com','Kevin Schaul','http://www.transistor.io', 'Jason Dorweiler'],
attribution web => ['http://kevinschaul.com','Kevin Schaul','http://www.transistor.io', 'Jason Dorweiler'],
email => ['kevin.schaul@gmail.com','Kevin Schaul','jason@transistor.io', 'Jason Dorweiler'];

spice to => 'https://congress.api.sunlightfoundation.com/legislators?apikey={{ENV{DDG_SPICE_CONGRESS_APIKEY}}}&chamber=$1&state=$2&per_page=all';
Expand Down
2 changes: 1 addition & 1 deletion lib/DDG/Spice/Forecast.pm
Expand Up @@ -15,7 +15,7 @@ code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/


my @triggers = ('forecast', 'forcast', 'weather', 'temp', 'temperature');
triggers any => @triggers;
triggers startend => @triggers;

spice from => '([^/]*)/?([^/]*)';
spice to => 'http://forecast.io/ddg?apikey={{ENV{DDG_SPICE_FORECAST_APIKEY}}}&q=$1&callback={{callback}}';
Expand Down
23 changes: 23 additions & 0 deletions lib/DDG/Spice/Gifs.pm
@@ -0,0 +1,23 @@
package DDG::Spice::Gifs;

use DDG::Spice;

primary_example_queries "funny cat gifs";
description "Animated Gifs";
name "Gifs";
source "Giphy";
code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/Gifs.pm";
attribution github => ['https://github.com/bsstoner','bsstoner'];

triggers any => "gifs", "gif";

# TODO: this is their beta/trial key, need to contact them if we want to srsly use:
spice to => 'http://api.giphy.com/v1/gifs/search?q=$1&api_key=dc6zaTOxFJmzC';
spice wrap_jsonp_callback => 1;

handle query_lc => sub {
return $_ if $_;
return;
};

1;
5 changes: 3 additions & 2 deletions lib/DDG/Spice/HackerNews.pm
Expand Up @@ -14,11 +14,12 @@ attribution github => ['https://github.com/adman','Adman'],

triggers startend => "hn", "hackernews", "hacker news", "news.yc", "news.ycombinator.com", "hn search", "hnsearch", "hacker news search", "hackernews search";

spice to => 'http://api.thriftdb.com/api.hnsearch.com/items/_search?q=$1&limit=50&weights[title]=1.1&weights[text]=0.7&weights[domain]=2.0&weights[username]=0.1&weights[type]=0.0&weights[points]=1.25&boosts[fields][points]=0.15&boosts[fields][num_comments]=0.15&boosts[functions][pow%282,div%28div%28ms%28create_ts,NOW%29,3600000%29,72%29%29]=200.0&callback={{callback}}';
spice to => 'https://hn.algolia.com/api/v1/search?query=$1&tags=story';
spice wrap_jsonp_callback => 1;

handle remainder => sub {
return $_ if $_;
return;
};

1;
1;
59 changes: 59 additions & 0 deletions lib/DDG/Spice/Images.pm
@@ -0,0 +1,59 @@
package DDG::Spice::Images;

use DDG::Spice;

use String::Trim;

spice to => 'https://127.0.0.1/i.js?q=$1&o=json&cb={{callback}}';

# Order matters for strip_qr.
my @any = (
'images',
'image',
'pics',
'pic',
'photos',
'photo',
'photographs',
'icons',
'icon'
);

triggers any => @any;
my $strip_qr = join('|',@any);
$strip_qr = qr/$strip_qr/;

triggers startend =>
'photograph',
'meme',
'memes',
'book cover',
'book covers',
'gif',
'jpg',
'png',
'logo',
'logos',
'wallpaper',
'wallpapers',
'wall paper',
'wall papers',
'screenshot',
'screenshots',
;

handle query_lc => sub {

my $query = $_;

$query =~ s/\s*$strip_qr//;
$query = trim $query;

# warn $strip_qr;
# warn $query;

return $query;
return;
};

1;
23 changes: 0 additions & 23 deletions lib/DDG/Spice/Local.pm

This file was deleted.

21 changes: 21 additions & 0 deletions lib/DDG/Spice/Maps/Directions.pm
@@ -0,0 +1,21 @@
package DDG::Spice::Maps::Directions;

use DDG::Spice;

spice to => 'https://127.0.0.1/directions/$1,$2,$3,$4';
spice is_cached => 0;
spice proxy_cache_valid => "418 1d";

triggers any => (
'directions to',
'directions from',
'directions',
);

handle query_lc => sub {
return $_ if $_;
return;
};

1;

23 changes: 23 additions & 0 deletions lib/DDG/Spice/Maps/Maps.pm
@@ -0,0 +1,23 @@
package DDG::Spice::Maps::Maps;

use DDG::Spice;

spice to => 'http://open.mapquestapi.com/nominatim/v1/search?format=json&json_callback={{callback}}&addressdetails=1&polygon=1&bounded=0&q=$1';
spice is_cached => 0;
spice proxy_cache_valid => "418 1d";

my %generic_map_queries = map {$_ => 0} ('map', 'maps', 'current location');

triggers any => keys(%generic_map_queries);

handle query_lc => sub {
# force generic
return if !exists($generic_map_queries{$_});

my $location = $loc->loc_str;
return $location if $location;
return;
};

1;

38 changes: 38 additions & 0 deletions lib/DDG/Spice/Maps/Places.pm
@@ -0,0 +1,38 @@
package DDG::Spice::Maps::Places;

use DDG::Spice;

spice to => 'https://127.0.0.1/local.js?q=$1&cb={{callback}}';

# no caching.
spice proxy_cache_valid => "418 1d";
spice is_cached => 0;

triggers any => (
'near',
'local',
'near me',
'around',
'here',
'locally',
'nearby',
'close',
'closest',
'nearest',

'locations',
'location',

'restaurant',
'restaurants',
);

my %skip_remainders = map {$_ => 0} ('current');

handle remainder => sub {
return $_ if $_ && !exists($skip_remainders{$_});
return;
};

1;

2 changes: 1 addition & 1 deletion lib/DDG/Spice/News.pm
Expand Up @@ -13,7 +13,7 @@ attribution github => ["https://github.com/duckduckgo/", "DuckDuckGo"],
twitter => ["https://twitter.com/duckduckgo", "duckduckgo"];

triggers startend => "news";
spice to => 'https://duckduckgo.com/news.js?q=$1&cb={{callback}}';
spice to => 'https://127.0.0.1/news.js?q=$1&cb={{callback}}';

handle query_lc => sub {
return $_ if $_;
Expand Down
2 changes: 1 addition & 1 deletion lib/DDG/Spice/Npm.pm
Expand Up @@ -19,7 +19,7 @@ spice wrap_jsonp_callback => 1;
triggers startend => 'npm';

handle remainder => sub {
return $_ if $_;
return lc $_ if $_;
return;
};

Expand Down
35 changes: 35 additions & 0 deletions lib/DDG/Spice/Recipes.pm
@@ -0,0 +1,35 @@
package DDG::Spice::Recipes;

use DDG::Spice;
use Text::Trim;

primary_example_queries 'tofu ginger recipe';
description 'Search for Recipes';
name 'Recipes';
code_url 'https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/Recipes.pm';

# removing line breaks from ingredients.txt file:
my %ingredients = map { trim($_) => 0 } share('ingredients.txt')->slurp;

triggers any => ('recipe', 'recipes', keys(%ingredients));

spice to => 'http://api.yummly.com/v1/api/recipes?q=$1&requirePictures=true&maxResult=35&_app_id={{ENV{DDG_SPICE_YUMMLY_APPID}}}&_app_key={{ENV{DDG_SPICE_YUMMLY_APIKEY}}}&callback={{callback}}';

handle query_lc => sub {
if ($_ =~ s/recipes?//g) {
return trim($_);
}

my $ingredient_count = 0;
my $non_ingredient_count = 0;
my @words = split(/\s/, $_);

foreach my $word (@words) {
exists $ingredients{$word} ? $ingredient_count++ : $non_ingredient_count++;
};

return $_ if $ingredient_count > 0 && $non_ingredient_count < $ingredient_count;
return;
};

1;
4 changes: 3 additions & 1 deletion lib/DDG/Spice/Snow.pm
Expand Up @@ -32,7 +32,9 @@ my %snow = map { $_ => undef } (
'is it snowing today',
'is it going to snow today',
'going to snow today',
'is it snowing yet'
'is it snowing yet',
'make it snow',
'let it snow'
);

handle query_lc => sub {
Expand Down
12 changes: 9 additions & 3 deletions lib/DDG/Spice/Video.pm → lib/DDG/Spice/Videos.pm
@@ -1,4 +1,4 @@
package DDG::Spice::Video;
package DDG::Spice::Videos;

use DDG::Spice;

Expand All @@ -12,8 +12,14 @@ attribution github => ["https://github.com/duckduckgo/", "DuckDuckGo"],
twitter => ["https://twitter.com/duckduckgo", "duckduckgo"];


spice to => 'https://duckduckgo.com/v.js?q=$1&n=20&callback={{callback}}';
triggers startend => 'video', 'videos', 'youtube';
spice to => 'https://127.0.0.1/v.js?q=$1&n=20&callback={{callback}}';

triggers any =>
'video',
'videos',
'youtube',
# 'vimeo',
;

handle remainder => sub {
return $_ if $_;
Expand Down
53 changes: 49 additions & 4 deletions share/spice/airlines/airlines.css
@@ -1,5 +1,50 @@
#spice_airlines .spice_pane {
display: inline-block;
width: 45%;
vertical-align: top;
.zci--airlines .tile.tile--c {
width: 37em;
}

.zci--airlines .tile__schedule {
color: #878787;
font-size: 12px;
}

.zci--airlines .tile__time {
font-size: 2em;
}

.zci--airlines .tile__heading {
margin-bottom: 1em;
}

.zci--airlines .tile__location {
font-size: 2em;
padding-bottom: 0;
padding-top: 0;
}

.zci--airlines .tile__ok {
color: #60AB5D;
}

.zci--airlines .tile__not {
color: #C14316;
}

.zci--airlines .tile__date {
color: #B3B3B3;
float: right;
text-align: center;
font-weight: 600;
}

.zci--airlines .tile__week {
font-size: 12px;
}

.zci--airlines .tile__day {
line-height: 12px;
font-size: 1.5em;
}

.zci--airlines .na {
color: #999;
}
7 changes: 0 additions & 7 deletions share/spice/airlines/airlines.handlebars

This file was deleted.