sindresorhus / emoj

Find relevant emoji from text on the command-line :open_mouth: :sparkles: :raised_hands: :horse: :boom: :see_no_evil:
MIT License
2.36k stars 58 forks source link

Use `emojilib` to enhance results #39

Closed stroncium closed 4 years ago

stroncium commented 5 years ago

Adds emojilib results to what we get from getdango.

Filtering of emojilib is done with simple heuristic(ignore some characters, do exact matches on long searches, substring matches on short searches).

Also, allowed using only emojilib if getdango API is not available for some reason.

Fixes #30 Closes #40

sindresorhus commented 4 years ago

This generally looks good :)

sindresorhus commented 4 years ago

There's a check in ui.js that checks if dango is offline. I don't think we need that anymore since we have this.

sindresorhus commented 4 years ago

Can you fix the merge conflict?

stroncium commented 4 years ago

@sindresorhus I think I cleaned up ui.js though I have no idea what it is used for/from so didn't test.

sindresorhus commented 4 years ago

I tried turning off my wifi, and it doesn't work:

› horse

GotError: getaddrinfo ENOTFOUND emoji.getdango.com emoji.getdango.com:80
    at onError (/Users/sindresorhus/dev/oss/emoj/node_modules/got/dist/source/request-as-event-emitter.js:140:29)
    at handleRequest (/Users/sindresorhus/dev/oss/emoj/node_modules/got/dist/source/request-as-event-emitter.js:173:17)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
stroncium commented 4 years ago

@sindresorhus Ok, figured it out now, didn't notice there was interactive mode. Getdango errors were thrown up in case local db got no results, ignoring them completely now.