duckduckgo / zeroclickinfo-goodies Goto Github PK
View Code? Open in Web Editor NEWDuckDuckGo Instant Answers based on Perl & JavaScript
Home Page: https://duckduckhack.com/
License: Other
DuckDuckGo Instant Answers based on Perl & JavaScript
Home Page: https://duckduckhack.com/
License: Other
Should just be a simple change to the regex and logic.
http://duckduckgo.com/?q=20%25+tip+of+43.3
should probably work
@400000004fd35af51f86bb6c Argument "\x{68}\x{75}..." isn't numeric in sprintf at /usr/local/ddg.cpan/perl5/lib/perl5/Number/UN.pm line 33.
"roll 2d6 + d4" etcetera would be great to have...
Gaganpreet @_gagan
@DuckDuckHack Results seem to be fixed to the server's timezone. A difference result, eg: "After 1 hour 5 minutes" will be much better.
92748926998277553042762371 should be UPS instead of USPS.
Query: unicode U+2000
DDG::ZeroClickInfo {
Parents WWW::DuckDuckGo::ZeroClickInfo
Linear @ISA DDG::ZeroClickInfo, WWW::DuckDuckGo::ZeroClickInfo, Moo::Object
public methods (4) : has_ttl, is_cached, new, ttl
private methods (0)
internals: {
answer " U+2000 EN QUAD, decimal: 8192, HTML:  , UTF-8: 0xE2 0x80 0x80, block: General Punctuation, decomposition: U+2002",
answer_type "unicode_conversion",
is_cached 1
}
}
Query: unicode ü
Sorry, no hit on your goodies
I'm writing a IDN/Punycode goodie, but I'm not sure how to test it for Unicode input as 'goodie test' does not appear to handle it correctly.
From feedback email:
guid / uuid
The GUID generator is a very useful feature.
However, could you please put some spaces before the GUID and at the end, and put the (randomly generated) on a separate line if you have to have it? It's very hard to select the GUID to copy/paste it presently.
Right now you have to enter "rcube stripes" (or rcube ), but it would be better if you just entered "rcube" or "rubiks cube patterns" and got a list of them all.
It seems people search binary * a bit and don't want/expect to get the goodie. Is there another way to segment it out like * (in|to) binary?
From a feedback email:
'roll dice' not working
While 'roll die', 'roll 2 dice', 'throw die', 'throw dice', and 'throw 2 dice' are all working, 'roll dice' is not.
It'd be sweet if the dice goodie used unicode to show results. Check out the characters at: https://en.wikipedia.org/wiki/Miscellaneous_Symbols
search for "die"
roll 2d6
could return 3 + 4 = 7
roll 3d20 + 4
: 17 + 13 + 14 = 44
An interesting feature of this concept would mean that we'd share the values of "-L" and "-H"
roll 4d6 - L
: 5 + 4 + 3 - 2 = 10
Like currency in AU
Also, what about money in AU?
Can use something like Locale::SubCountry::World; for that
E.g. two letters like zl
Should work with countries that typically include an artiticle : "currency in the united states"
Query: days between 1/1/2000 1/1/2001
reports: 366 days between
I suppose that means inclusive? We should note this or present both options like
365 (in between), 366 days (inclusive), 364 (not counting either end)
This came in over feedback:
Hey it's pretty cool that DDG can roll dice for queries like "3d6+4"!
And it even accepts irregular dice like 3d17 :-)
But can you also make it accept multiple dice, such as "3d10 + 2d6 + 3" ?
And maybe multiple rolls, like "1d20+7, 2d4+1" (which wouldn't summ all results, but rolls to-hit and damage at the same time and reports both).
From email:
"Em is a relative unit. Relative to the current point size of the font.
To have a real conversion from em to px, you must have the point size
of the used font and the dpi of the used display. What duckduckgo
currently returns is just division/multiplication by 16 which is true
for only some very specific font size / display combinations."
Sorry for the delay in integration lately. We've been trying to work on a better interface between the repositories and the core system, and I've been working on a redesign of the site (almost done). We won't wait until the new interfaces are done to integrate, though. I'll be getting on that ASAP.
Onto the issue!
I've been thinking that a more visual, public request board would be better than the scattered txt files and wikis. I put together a Trello board for this purpose and I'm wondering what you all think about it: https://trello.com/board/goodies/4f08e96d947729b526070890
It is set up for public voting and commenting, so anyone who wants (even without technical skill) can engage with it.
"Very strange bug,
http://duckduckgo.com/?q=percent+html works
http://duckduckgo.com/?q=percent+symbol+html doesn't work
"
Feedback:
Binary for nonascii characters
When trying "binary" in search I do not get binary representation of nonascii characters. I get eight bits of something that I believe is first byte of its UTF-8 representation.
Right now the output looks like this: 5 letter words: fuzzy, upend, cared, mauls, quill, chips, wanes, spend, boron, laces, bayou, bluff, fight, bimbo, hoops, learn, vices, moths, rehab, imply, aegis, broil, thief, users, swear, trump, kiddo, nukes, vexed, mulch
I wonder if we should say it is random, like Random 5 letter words.
End with a period?
Edited from feedback:
Why can I not roll more than 2 digits worth of dice; for example, I can roll 99d6, but I cannot roll 100d6. I imagine you coded it like this for a reason, however if you could up that to maybe 4 digits, it would be better.
For example, "roll d6+l". [+-][lh] is matched, but + is not handled in this case at all. Instead it is passed to int(), resulting in a warning (which is fatal on the live platform).
"flip abc" gives ɔqɐ so "flip ɔqɐ" should give "abc."
If you take a look at the fliptext-reverse branch, I've extended the hash to include reversed elements for each of the unicode characters.
This isn't enough though; it's still not working in duckpan query. If you can make it work, please submit a pull request with your changes.
Aww, one of my favorite goodies I worked on back in the day is no longer handling one of its special cases. The code for -L and -H is still in dice.pm but it must no longer be matching its execution pattern correctly.
The deal is to have the dice goodie respond to standard dice notation:
roll 4d6 - L # roll 4 six-sided die and subtract the lowest value
roll 3d12 - H # roll 3 twelve-sided die and subtract the highest value
https://duckduckgo.com/?q=424334%2B2253828
vs
https://duckduckgo.com/?q=4%2C24%2C334%2B22%2C53%2C828
The issue here is with comma -> period conversion, which is in place right now because of the way some non-U.S. numbers are formatted with commas. That line should be qualified with a check to make sure the comma formatting is appropriate before turning commas into periods. If the formatting isn't appropriate (e.g. this case) the numbers will fall through to the line that strips all the commas and the answer will be shown as desired.
Given the current implementation of the Coin Goodie, this might not be as easy as it probably should be to extend. It should probably be re-written to be a little more flexible with the kinds of queries it can handle.
It would be nice if the user could also have a result of and/or/not bitwise operations between two numbers.
The source site for man pages is a little dated, and a little unsupported
has a broken image in the front page, and a copyright notice from 1994. I am sure that it is a great site, and has been useful for almost 20 years, but ddg might want to use a more inclusive site.
Hey Guys, I noticed capitalize is still on Trello under ideas, I was gonna give it a go implementing it but I noticed its already on here. However, I tried it on DDG and I don't believe its working...
Thought I'd let you know!
The following characters don't work with Morse entry:
e
h
i
s
5
Original issue:
https://duck.co/topic/morse-code-0-click-doesn-t-work-for-some-valid-input
Looks like these characters (in morse, intended as conversion to text) are being overriden by a "Morse" disambiguation.
https://duckduckgo.com/?q=178440515632684
https://duckduckgo.com/?q=fedex+178440515632684
Adding "fedex" to the search makes it work properly but I think previously that wasn't necessary
https://duckduckgo.com/?q=710379288072 is another one
This module requires the Perl modules DDG::Goodie
and DDG::Test::Goodie
which are not mentioned in dist.ini
nor included in this repository. I finally found them in https://github.com/duckduckgo/duckduckgo (not on CPAN). No, I don't want to use duckpan but first just write and test a Goodie like any other Perl/CPAN module.
Braille characters searched should return an english translation.
You'll need to expand the trigger to fire whenever a braille character is present. To do this, use a regex trigger so you don't have to list out all the characters. Check out this wikipedia page for the name of the code block. Look here on perldoc for how to reference a unicode block inside a regex (you only need the simple 'single form'). To use the regex instead of a 'word' trigger, it's as simple as triggers any => qr/your_regex_here/
.
Once you've got it triggering correctly, look at the cpan package for a braille-to-english conversion function.
Like five letter words.
E.g. blowjob
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.