Add Localhost Goodie #134

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

kennydude commented Nov 4, 2012

I'm guessing I've branched this right, but I added a Localhost goodie! :D

Will solve this: https://duckduckhack.uservoice.com/forums/5168-plugins/suggestions/3163137-searching-localhost-should-return-http-localh

jagtalon was assigned Nov 15, 2012

@jagtalon jagtalon commented on the diff Oct 28, 2013

lib/DDG/Goodie/Localhost.pm
@@ -0,0 +1,14 @@
+package DDG::Goodie::Localhost;
+
+use DDG::Goodie;
+
+triggers query_nowhitespace => qr!^(http://)?localhost(.*)$!;
+
+zci is_cached => 1;
+zci answer_type => "localhost";
+
+handle matches => sub {
+ return "Did you mean to go to <a href='http://localhost" . $_[1] . "'>http://localhost" . $_[1] . "</a>?";
@jagtalon

jagtalon Oct 28, 2013

Owner

Maybe we should only check for the :\d+ pattern? This will still return for "localhost.com" (which actually redirects to google.com).

@jagtalon

jagtalon Oct 28, 2013

Owner

Hang on, you're right about the paths, though. Maybe we can just check for either paths or ports, but not important. :)

Member

majuscule commented Nov 1, 2013

Hi @kennydude,

There's no excuse for taking so long to ge back to you (I'm very sorry), but we had a discussion about this and it was decided that this should be handled in our internal misspelling code for UI consistency, rather than as a Goodie. That said, it still has not been implemented. I am creating an issue for this functionality now, and it should be added soon.

Thank you very much for your time and understanding,
Dylan

majuscule closed this Nov 1, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment