duckduckgo / zeroclickinfo-spice

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

Convert IAs to newest Spice API #1896

Closed moollaza closed 9 years ago

moollaza commented 9 years ago

There are still many IA's in the repo that use the old API, that aren't wrapped in a closure, and most importantly aren't calling Spice.failed() when they trigger.

We need these IA's to be updated and they need to call Spice.failed() when necessary so the other IA's waiting to show their answers know that the triggered Spice isn't going to produce anything.

Here's a list of the IA's that use the API:


Some of these are currently offline as they were never updated and re-deployed. We'd love to have them go live if they're able to!

The IA's that are currently functioning are a higher priority!

pnpninja commented 9 years ago

I'll take up forvo.

moollaza commented 9 years ago

@pnpninja wonderful! There's a little more discussion about how it should be done here: https://github.com/duckduckgo/zeroclickinfo-spice/issues/1509

iambibhas commented 9 years ago

For some reason searching for smbc is triggering the Zipcode spice which is breaking itself and smbc. This is the url being called - https://ddh1.duckduckgo.com/js/spice/zipcode/SMBC/ZZ which doesn't return any JS code in my case, but triggers a search on ddh1.

iambibhas commented 9 years ago

Oooops! @moollaza I think Github closed this automatically because I mentioned Fixes #1896 in PR description. :|

jagtalon commented 9 years ago

@moollaza I forget why we didn't release SMBC before, but seems like a good IA to have around.

iambibhas commented 9 years ago

The API endpoint being used for SMBC is not official and seems like dead. Last item is from March http://comics.signedzero.com/smbc/feed.json

alohaas commented 9 years ago

Hey @moollaza, I'd like to work on Forecast. I noticed that it isn't using moment.js to generate dates as suggested in issue #1554, but Forecast isn't one of the IAs listed in that issue's checklist. Would moment.js integration be helpful for the Forecast IA?

moollaza commented 9 years ago

Hey @alohaas, you're welcome to work on the Forecast IA, but I'm worried that the work might not be worth the gain in this case. It's one of the more complex & unique IA's given the way it works so I think I had left it out.

I belive in order to get things working, you'll need to reorganize the code so that the Spice.add() is wrapped in a DDG.require() call, so you can have access to Moment.js inside a normalize: () block.

Right now, Forecast does all of the work before the Spice.add() call, which means Moment.js hasn't been loaded yet (though there's a chance I'm wrong about that...).

alohaas commented 9 years ago

Ah, yeah, maybe not the best use of time. Thanks for the help. In that case, I'd like to implement the new API for Forecast.io and use the time I would have spent on adding Moment.js to Forecast to focus on updating the IAs still using the old API. In that case, I'd like to implement the new API for Forecast.io and use the time I would have spent on adding Moment.js to Forecast to focus on updating other IAs still using the old API.