GithubHelp home page GithubHelp logo

duckduckgo / zeroclickinfo-spice Goto Github PK

View Code? Open in Web Editor NEW
548.0 111.0 948.0 19.27 MB

DuckDuckGo Instant Answers based on JavaScript (JSON) APIs

Home Page: https://duckduckhack.com/

License: Other

Perl 42.49% CSS 4.93% JavaScript 45.94% Python 0.26% Shell 0.08% Raku 1.08% Handlebars 5.22%
instant-answers javascript perl duckduckgo handlebars-js

zeroclickinfo-spice's Introduction

This repo is now archived

DuckDuckHack went on maintenance mode in 2015 and we aren't in a position to continue it. This repo hasn't been maintained subsequently and so we are archiving it.

Need to report a bug?

If you find a bug or relevancy issue, the best way to report this is via the Feedback button on the DuckDuckGo.com search results page. These issues are compiled and reviewed daily.

Have a suggestion or idea?

The best way to report these is also via the Feedback button on the DuckDuckGo.com search results page.

You can also share your thoughts with our community on Reddit.

zeroclickinfo-spice's People

Contributors

adman avatar ajainy avatar b1ake avatar b2ddg avatar bigcurl avatar brianrisk avatar bruvellu avatar bsstoner avatar claytonspinner avatar ghedo avatar hunterlang avatar jasonodonnell avatar jcdogo avatar killerfish avatar majuscule avatar mariagraziaalastra avatar mattr555 avatar moollaza avatar mrchrisw avatar mwmiller avatar nilnilnil avatar puskin94 avatar russellholt avatar sahildua2305 avatar sekhavati avatar tagawa avatar taw avatar tombebbington avatar tommytommytommy avatar zachthompson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zeroclickinfo-spice's Issues

Remove images from IMDB Spice

Seeing as IMDB is blocking our IP, we might as well remove the images for now. They broken image icon looks bad...

Switch Zanran spice to use trigger words

There are other similar plugins such as Search_Code and Code_Search which should also be switched over to use word triggers because they are considerably faster and less taxing on the backend.

Also, we should add a little logic to make sure the trigger word isn't the entire query. This would also be made easier if we use trigger words.

A nice solution for creating the trigger words would be to slurp a text file and create a word trigger from each line, similar to the airlines plugin. It would at least look a littler nice than having a massively wide/tall list of words.

Also, it should be able to trigger on the word "Zanran".

Working on DDG plugin for yipp.it

As requested in the README, I wanted to let everyone know that I'm working on a DDG spice plugin for yipp.it. It will display the latest news article that yipp.it has pertaining to the search. (e.x. Someone searches "greece news". The plugin will return the newest article that yipp.it has that pertains to Greece.)

I will start a pull request for the code when I'm done with it.

duckpan spice testing ssl_error_rx_record_too_long

It appears the query duckpan wants to submit queries via https but only http is allowed and configured to be used by the server.

Manual entry in the address bar of queries works with http but https

FYI

Handling Zip code with Wolfram Alpha

I have noticed that DDG uses WA as a major source for zero click info. How do you tell it to call WA on some trigger? For example, I have found that the query "zipcode 12345" is best served by the information from WA. Since I presume DDG already has an easy to call WA on some triggers, I think it is better if it is added to that list instead of creating a new spice that essentially does the same thing.

Translator Request

Are we against using Google Translate's API for the translator request?

Forvo: Trouble with Firefox

Forvo would show NaN on the controls when playing it on Firefox:

Linux:
Selection_032

Windows:
Selection_031

OS X:
Selection_033

Also says that the page is insecure (I only saw this on Windows, though, and we can fix this by using a proxy):
Selection_030

Add more/better triggers to Rotten Tomatoes

There are probably a lot of triggers we can add to these spices such as:

release date
runtime | length | hours | how long is
cast of
actors in
plot | premise | synopsis | overview | summary

The other issue is that we need to make sure the api's will return the relevant information. Otherwise we need to seek out a better, more robust movie api (or separate movie API's) which can provide the best answers for these kinds of queries.

UK postcode without a space doesn't trigger

I often enter postcodes without a space "ox13dr", rather than say "ox1 3dr". In the United Kingdom, there is no ambiguity in missing the space, and people often do that when typing them for searches.

The MapQuest map is triggered when I include the space, not triggered when I don't.

In the Zipcode.pm spice, there are a bunch of quite generic regular expressions which I don't understand the international implications of in full to offer a patch.

Bible abbreviations

From feedback:


Currently you type Genesis 1:2 to get "Zero-click Info sources". This could be more useful if it also works with Bible abbreviations, e.g., gen 1:2 for Genesis 1:2, phil for Philippians, etc.

SearchCode Relevancy Error

@boyter a DDG search for "IOS 6" returns a really irrelevant result...
Have a look: https://duckduckgo.com/?q=iOS+6 -- any thoughts?

EDIT: Sorry I though the problem was the relevancy of the result, clearly its not irrelevant it relevant to IOS, but the issue is that it looks like the "6" might not be being used correctly in the DDG.is_Relevant function because it looks like its being captured in the date " 6 January 1965". The context of the 6 in the result is incorrect. Perhaps we need to do a check for digits after the mention of certain terms because they might be version numbers?

Would there be any results that would have "IOS 6" in the title?

add explainxkcd.com to XKCD zero-click

Randall often writes comics that relate closely to the US cultural background, difficult to grasp for non-US folks. That's why the website http://www.explainxkcd.com popped up.

Would it be possible to obtain the explainations above for the XKCD zero-click search? I suggest to add a button like "didn't get the catch?" so that the explaination is optional, but still available.

Cheers,

Small bug in HN Spice - Need check for the "discussion" attribute

Searching hn best blogging platform surprisingly gives no results.

However searching hn blogging platform gives results.

There seems to be a java script error in the first search due to a missing value in the json which has no check to make sure it exists!

It seems most "comments" have a discussion attribute which also have the title of the thread being commented on. However the second comment result from the first search is missing the discussion attribute.

Clearly a check is missing for the "discussion" attribute.

#sxswm kindalike

@yegg
A event reccommender system (initial for sxsw but portable to other events)
idea: identify musical talent events at south by south west that might fit a description or be similar in style to well known bands across all genres

3rd parties Leveraged:

  • LastFm
  • Twitter
  • Foursquare
  • sched.com for scheduling info

e.g.
sxsw kindalike the beatles

  • band abc
  • band dba
  • singer xyz

sxsw kindalike metallica tonight
* gives results for events that might match that night

sxsw kindalike Al Jarreau cool now
* gives results that might be similar to Al Jarreau
* narrows results to (hot/cool) based on recent geo activity via twitter and 4square

Yes its a rush job but I think it could be a mutually beneficial project for DDG and any of the active devs interested
Will start with enough interest from core DDG

A more informative User-Agent?

At the moment I notice that ddg is faking a browsers user agent on zeroclick api requests.

Specifically, I get:

Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.127 Safari/534.16

Is there a reason to not be providing a better user agent that describes what is actually making the request?

JavaScript Error IE9 Windows 7 Spice Trigger Issue

Windows 7 x64
IE9
Chrome 24.0.1312.52 m
Trigger text "ios 6" https://duckduckgo.com/?q=ios+6

Encountered the following error, for IE9. Searching for ios 6 https://duckduckgo.com/?q=ios+6 triggers the below.

Line: 1
Error: 'ddg_spice_search_code' is undefined

ddg_spice_search_code({"results":[{"name":"dateFromComponents:","namespace":"NSCalendar.dateFromComponents:","url":"http:///developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSCalendar_Class/ReferenceNSCalendar.html#//apple_ref/occ/instm/NSCalendar/dateFromComponents:","description":"Returns a new NSDate object representing the absolute time calculated from given components. When there are insufficient components provided to completely specify an absolute time, a calendar uses default values of its choice. When there is inconsistent information, a calendar may ignore some of the components parameters or the method may return nil. Unnecessary components are ignored (for example, Day takes precedence over Weekday and Weekday ordinals). The following example shows how to use this method to create a date object to represent 14:10:00 on 6 January 1965, for a given calendar (gregorian). Note that some computations can take a relatively long time to perform. Available in iOS 2.0 and later.","synopsis":"(NSDate *)dateFromComponents:(NSDateComponents *)comps","type":"appleios","icon":"apple.ico","displayname":"Mac iOS Reference","modeltype":"function","rank":9}],"page":0,"total":"1","searchterm":"ios 6","query":"ios 6","matchterm":"ios 6","cleanterm":"","generalregex":"","regex":"","nextpage":1,"previouspage":null})

If you step through the spice code it renders as expected. Rerun and its call cached so no issues there. Clear cache and rerun you can repeat the above.

Switch Twitter to word trigger, update README accordingly.

Just realized that Twitter is using a regex and only matches very specific queries. We should really switch it to a word trigger so it triggers on "@".

If this change is made the DuckDuckHack documentation will also need to be updated accordingly.

We should also probably make a twitter search spice so "twitter Zaahir Moolla" would search for users with that name and return a list of possible matches (similar to Google+)

I'm not sure if all that's possible but it would be nice.

Add !G to user preference options

Some folks (myself included) are curious if we can use DDG preferences to default searches to !g to utilize the non tracking features with google search results. If so, can this option be made more obvious and if not can this become a feature?

Github duplicates

If you look at something like https://duckduckgo.com/?q=github+weather or https://duckduckgo.com/?q=github+zeroclickinfo

They have a lot of duplicates (due to forks) and some that have no descriptions (due to not being there I suppose).

Is there a way to either filter these out and default to the main ones or sort them so the main ones are at the top and the forks/ones with less info are at the bottom? Also, we could include the name of the person/group to make things not duplicate.

Zanran: Url escaping issue with API requests

I've seen a ton of malformatted URLs in logs coming from DDG plugin for zanran.

I thought it might be an error in the plugin, but it doesn't seem so.

When I search for:

saudi arabia "oil production"

with duckpan server, this apparently correct URL gets generated:

GET /search/simple_json?callback=ddg_spice_zanran&q=saudi%20arabia%20%22oil%20production%22
HTTP/1.1

then zanran API returns correct result, and everything works.

But the same search on duckduckgo.com generates this:

GET /search/simple_json?callback=ddg_spice_zanran&q=saudi%20arabia%20"oil%20production"
HTTP/1.0

With nothing except spaces escaped, and server returns error due to
malformatted URL.

I think any query with weird characters like quotation marks in it is
likely to be affected.

It's not a big deal since it's presumably only a tiny fraction of all queries,
but it might affect other plugins as well, and it's probably pretty
simple to fix.

Or as a workaround zanran plugin's spice.js could just replace most punctuation
with spaces before sending API request instead of after.
(zanran API tries to handle punctuation semi-intelligently replacing & with and,
stripping 's etc., but it probably doesn't matter all that much,
it's just a series of preprocessing regexps).

IMDb Tom Hanks

Currently IMDb Tom Hanks returns movie info (as opposed to the actor). I understand why -- because we're using a third-party API that only looks up movies, but it is a poor experience.

Perhaps we can expose some internal name detection for this piece.

CodeSearch +# not matched correctly

Was playing around and noticed the following issue,

A search for the following

code c++ test
code c# test

Actually ends up pulling back results for "c"

The issue appears to be in the following piece of code,

if ($_ =~ m/$words/i) {
    $_ =~ s/$words//i;
    return "lang:".$1." ".$_;
}

It would appear that when it triggers on "code c# test" when it returns the following,

lang%3Ac%20%23%20test

which of course is

lang:c # test

Hence the issue, as it should be

lang:c# test

Had a go fixing this, but I literally know zero Perl and couldn't resolve it so thought I would throw the issue in here.

Last.fm API Suggestion

We could use last.fm's API to display information when users type Maroon 5 albums. The albums could be displayed as a row of images similar to the alternative to plugin. I can apply for an API account (http://www.last.fm/api/account) but I'm not quite sure if I should choose Commercial or Non-commercial use.

I look forward to getting your feedback!

Switch over spice plugins with regex to trigger words (where applicable)

Plugins that use trigger words are significantly more efficient. We should really move over as many "regex" plugins as possible (especially those that have use a specific trigger word) to rather trigger initially on that word and in the handle statement use a regex to disqualify any inappropriate searches.

Zip code area potentiall off

From feedback


Lookup: 21835 on Google, then on DuckDuckGo.

Google simply brings back the relevant result:
Linkwood, MD 21835

DuckDuckGo returns Dorchester County which is a much bigger area.


CodeSearch Issue

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

I just realized a bug that has crept into this. The "lang:" should prefix the language words.

EG.

code python foreach TO lang:python foreach
code php $this-> TO $this-> lang:php
code goto TO goto lang:perl

As it is you end up with queries like,

code foreach TO lang:foreach

Which returns nothing useful at all, as the lang syntax is trying to restrict to the langage "foreach" which is nonsensical. The syntax is copied from the original google code search. http://en.wikipedia.org/wiki/Google_Code_Search

Noticed when going through some logs. An example that's on the live site would be,

http://duckduckgo.com/?q=code+foreach

Improve IMDb implementation

Certain things are missing such as error checking. The spice should really meet the canonical plugin format.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.