Comments (7)
Had a dig and found the following examples of searches which are hitting the api, but are probably not useful.
lang:ehcache
lang:battle field 3 multiplayer ps3
lang:pthread_mutex
lang:ehcache
lang:csv file
lang:att wireless coupon
lang:mediawiki inline
lang:chmod for read write execute
lang:ehcache.xml
lang:fire emblem 8 cheat
lang:xfetchname
lang:android doubletwist retail
lang:yacc source
lang:search for copy and paste
lang:pthread_mutex_t
lang:plantronics 360 bluetooth pairing
Some would produce useful results EG,
pthread_mutex_t
I have modified the searchcode end to ignore nonsensical language lookups EG
http://duckduckgo.com/?q=example+pthread_mutex
http://duckduckgo.com/?q=example+pthread_mutex_t
http://duckduckgo.com/?q=example+ehcache
now returns something which makes sense.
from zeroclickinfo-spice.
@boyter sorry for the delayed response and thanks for letting me know about this bug. I think the bigger problem is that the spice is triggering simply on "code" or "example" and following through with a result despite the absence of a "language" . I thought I had written the spice so that it would force the presence of one of your keywords - however it seems my code isn't doing that so I believe there is an error in my regex. I'll fix it up and we can go from there.
EDIT: Also I think I'll use the regex optimizer I previously used for the ExpandURL Spice to make the regex a little more efficient
from zeroclickinfo-spice.
No problem at all. I just fixed it on my end as much as possible so the results shouldn't be too bad now. The experience was really crappy before I made the modification as it was always showing a make file for all results before. Looks bad for DDG and for myself, so I fixed it, and made it more resilient anyway.
In some cases it actually works out better such as the examples above as they do give what I would expect.
from zeroclickinfo-spice.
@boyter I think i figured it out! small mistake...the list of words in the $words variable weren't surrounded by '\b' so it was picking up the "|c|" in any words that had just the letter c in them hence "example foreach" worked but "example testing" didn't trigger.
Now it will force your keywords to be present. Better?
from zeroclickinfo-spice.
@moollaza Yep, with the only exception being you are assuming that the language keyword is at the beginning of the query, which might not be the case. IE
example csv validator java TO lang:csv validator java
Would try to match on the language csv which does not exist. It's taken care of on the searchcode side though as I strip out the lang: portion where there is a language which matches nothing. I might modify it on that side anyway to search for keywords like java in the case of there being no lang syntax present and restrict it that way.
from zeroclickinfo-spice.
@boyter I had thought about that right after I made my earlier fix. I changed the regex to now strip the keyword, append "lang" to it, then append the rest of the search query. I pushed it to github, feel free to give it a look.
from zeroclickinfo-spice.
Looks good to me. I have been playing a bit and it certainly seems to pick things up much better now.
from zeroclickinfo-spice.
Related Issues (20)
- Location Sunrise/Sunset: HOT 2
- Instant answer feature not working for all stocks HOT 1
- Word definitions can't be copied HOT 1
- Translation: Instant answer doesn't work HOT 4
- Quote Of The Day: HOT 1
- BrainyQuote:
- Congress: HOT 1
- Amazon:
- Editor: doesnt show up after searching "editor" HOT 1
- Currency Conversion: HOT 3
- BBC: Access is currently only available to BBC employees HOT 1
- Actor Filmography: queries do not work HOT 1
- NFL Games: Suggestion: Add timezone info
- Actor Filmography: HOT 1
- Editor: not working HOT 3
- Translation Suggestion: Amazon Translate as upstream provider HOT 2
- Dictionary Definition:
- Currency Conversion Not Working HOT 2
- Amazon: HOT 1
- Cryptocurrency: Not rendering IA results HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zeroclickinfo-spice.