GithubHelp home page GithubHelp logo

sindresorhus / alfred-emoj Goto Github PK

View Code? Open in Web Editor NEW
366.0 8.0 20.0 265 KB

Alfred 3 workflow to find relevant emoji from text

License: MIT License

JavaScript 100.00%
alfred alfred-workflow alfred3-workflow emoji alfy npm-package emoji-picker emoji-searcher nodejs macos

alfred-emoj's Introduction

alfred-emoj's People

Contributors

mmccoy avatar richienb avatar samverschueren avatar sindresorhus 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

alfred-emoj's Issues

Emoji source host down?

Hi Sindre,

As of today, I'm receiving a failure when fetching emoji results.. Seems like the host is down.

RequestError: getaddrinfo ENOTFOUND emoji.getdango.com
    at ClientRequest.<anonymous> (/Users/mmccoy/Dropbox/Alfred/Alfred.alfredpreferences/workflows/alfred-emoj (Symlink Backup Copy)/node_modules/got/index.js:182:22)

Emoj 2.0.0
Alfred 4.1.1
darwin x64 19.6.0

No Results

Get:

ParseError
    at stream.catch.then.data (/Users/joebob/.nvm/versions/node/v7.5.0/lib/node_modules/alfred-emoj/node_modules/got/index.js:118:14)

TypeError: binary is not a function

Hi, I'm getting the following error when activating the workflow. Any ideas what's causing it?

```
TypeError: binary is not a function
    at ClientRequest.<anonymous> (/usr/local/lib/node_modules/alfred-emoj/node_modules/got/index.js:44:62)
```

-
Emoj 0.2.0
Alfred 3.1.1
darwin x64 14.5.0

Error installing on OSX

Hey there!
I'd love to try this out, but I get this:

MacBook:~ max$ sudo npm install --global alfred-emoj
npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead!
\
> [email protected] postinstall /usr/local/lib/node_modules/alfred-emoj
> alfy-init

{ [Error: Command failed: alfred-link
[Error: Alfred preferences not found at location /Users/max/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist]
]
  code: 1,
  killed: false,
  stdout: '',
  stderr: '[Error: Alfred preferences not found at location /Users/max/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist]\n',
  failed: true,
  signal: null,
  cmd: 'alfred-link' }
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--global" "alfred-emoj"
npm ERR! node v4.6.1
npm ERR! npm  v2.15.9
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: `alfy-init`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script 'alfy-init'.
npm ERR! This is most likely a problem with the alfred-emoj package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     alfy-init
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs alfred-emoj
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls alfred-emoj
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/max/npm-debug.log

Keep up the great work!
Max

Evaluation version of API causing JSON parse error

The response from the Dango API is something in the form of:

*** Evaluation version. Please subscribe to full version.
{"items":[{"title":"🍌","arg":"🍌","icon":{"path":" "}},{"title":"👑","arg":"👑","icon":{"path":" "}},{"title":"💎","arg":"💎","icon":{"path":" "}},{"title":"😋","arg":"😋","icon":{"path":" "}},{"title":"✨","arg":"✨","icon":{"path":" "}},{"title":"👅","arg":"👅","icon":{"path":" "}},{"title":"♥","arg":"♥","icon":{"path":" "}},{"title":"🐒","arg":"🐒","icon":{"path":" "}},{"title":"🍨","arg":"🍨","icon":{"path":" "}},{"title":"🍞","arg":"🍞","icon":{"path":" "}},{"title":"🍌👑💎😋✨👅♥🐒🍨🍞","arg":"🍌👑💎😋✨👅♥🐒🍨🍞","icon":{"path":" "}}]}

which unsurprisingly results in a JSON parse error:

2016-06-28 09:49:21][ERROR: input.scriptfilter] JSON error: JSON text did not start with array or object and option to allow fragments not set. in JSON:

😢🐼

A .alfredworkflow download within the releases

Hey @sindresorhus,

Thanks for building a useful tool. We all love emoji's isn't it :-)

The npm install did not work for me. While I am looking into why it did not work, I wonder how nice it would be to have a alfredworkflow download file.

Is this something that is on your agenda for the next releases?

no workflow was created after installation

I use nvm and customized the location of my Alred workflow directory.

❯ npm install alfred-emoj

> [email protected] postinstall /Users/andreas/node_modules/alfred-emoj
> alfy-init

npm WARN saveError ENOENT: no such file or directory, open '/Users/andreas/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/andreas/package.json'
npm WARN andreas No description
npm WARN andreas No repository field.
npm WARN andreas No README data
npm WARN andreas No license field.

+ [email protected]
added 135 packages in 10.624s

No workflow was created, but something was done to my home directory. Any idea?

Error - certificate has expired

Cannot use the plugin since today(used it yesterday). It was working fine yesterday.

This is the error I am getting.

RequestError: certificate has expired
    at ClientRequest.req.once.err (/Users/arijit/.nvm/versions/node/v8.9.4/lib/node_modules/alfred-emoj/node_modules/got/index.js:73:21)

Emoj 1.0.0
Alfred 3.6.2
darwin x64 17.6.0

Here's a quick video(usual alfred error thrown)

In fact the emoj-cli is also throwing the same error.

Error: Cannot find module '.'

not sure if this is a problem on my side, but I cannot install the latest version of alfred-emoj:

lucaban@Golden-Birdie ~> npm i -g alfred-emoj@latest

> [email protected] preuninstall /usr/local/lib/node_modules/alfred-emoj
> alfy-cleanup

Error: Command failed: alfred-unlink
internal/modules/cjs/loader.js:800
    throw err;
    ^

Error: Cannot find module '.'
Require stack:
- /usr/local/lib/node_modules/alfred-emoj/node_modules/.bin/alfred-unlink
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/alfred-emoj/node_modules/.bin/alfred-unlink:3:20)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/local/lib/node_modules/alfred-emoj/node_modules/.bin/alfred-unlink'
  ]
}


    at makeError (/usr/local/lib/node_modules/alfred-emoj/node_modules/execa/index.js:174:9)
    at /usr/local/lib/node_modules/alfred-emoj/node_modules/execa/index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  code: 1,
  stdout: '',
  stderr: 'internal/modules/cjs/loader.js:800\n' +
    '    throw err;\n' +
    '    ^\n' +
    '\n' +
    "Error: Cannot find module '.'\n" +
    'Require stack:\n' +
    '- /usr/local/lib/node_modules/alfred-emoj/node_modules/.bin/alfred-unlink\n' +
    '    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)\n' +
    '    at Function.Module._load (internal/modules/cjs/loader.js:690:27)\n' +
    '    at Module.require (internal/modules/cjs/loader.js:852:19)\n' +
    '    at require (internal/modules/cjs/helpers.js:74:18)\n' +
    '    at Object.<anonymous> (/usr/local/lib/node_modules/alfred-emoj/node_modules/.bin/alfred-unlink:3:20)\n' +
    '    at Module._compile (internal/modules/cjs/loader.js:959:30)\n' +
    '    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)\n' +
    '    at Module.load (internal/modules/cjs/loader.js:815:32)\n' +
    '    at Function.Module._load (internal/modules/cjs/loader.js:727:14)\n' +
    '    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {\n' +
    "  code: 'MODULE_NOT_FOUND',\n" +
    '  requireStack: [\n' +
    "    '/usr/local/lib/node_modules/alfred-emoj/node_modules/.bin/alfred-unlink'\n" +
    '  ]\n' +
    '}\n',
  failed: true,
  signal: null,
  cmd: 'alfred-unlink',
  timedOut: false,
  killed: false
}

Workflow isn't listed in Alfred after install

Hi Sindre,

I just tried to install your workflow:

npm install --global alfred-emoj

> [email protected] postinstall /usr/local/lib/node_modules/alfred-emoj
> alfy-init

+ [email protected]
added 200 packages from 69 contributors in 7.532s

I got no errors, but the workflow isn't listed in Alfred. I guess this might be related to the latest major Alfred upgrade.

Here is my environment:

  • Alfred 4.0.2 [1088]
  • Node.js v12.3.1
  • npm 6.9.0

Let me know if you need more information from me!

HTTPError (Api-limit reached?)

I can't use the workflow anymore :(

[2017-08-10 15:04:02][ERROR: input.scriptfilter] Code 1: {
	"items": [
		{
			"title": "HTTPError\n    at stream.catch.then.data (/Users/tsc/.nvm/versions/node/v8.1.3/lib/node_modules/alfred-emoj/node_modules/got/index.js:123:13)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:169:7)",
			"subtitle": "Press ⌘L to see the full error and ⌘C to copy it.",
			"valid": false,
			"text": {
				"copy": "```\nHTTPError\n    at stream.catch.then.data (/Users/tsc/.nvm/versions/node/v8.1.3/lib/node_modules/alfred-emoj/node_modules/got/index.js:123:13)\n    at <anonymous>\n```\n\n-\nEmoj 1.0.0\nAlfred 3.3.2\ndarwin x64 16.7.0",
				"largetype": "HTTPError\n    at stream.catch.then.data (/Users/tsc/.nvm/versions/node/v8.1.3/lib/node_modules/alfred-emoj/node_modules/got/index.js:123:13)\n    at <anonymous>"
			},
			"icon": {
				"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
			}
		}
	]
}

TypeError when there are no results

I'm pretty sure that this is because the API isn't returning results for the search query, which leads to there not being an array to map.

TypeError

Wasn't able to find node on my system

Hi, thanks for this. Super cool.

I had to tweak some things to get this to work. Don't know if it's my environment but could be useful to know. It wasn't working, I turned on the debug output and got this:

[2016-06-26 21:21:33][ERROR: input.scriptfilter] Code 127: bash: no job control in this shell
/Users/adz/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Scripts/F7C3D82A-57F6-4032-92FF-E179415ACB0D: line 2: node: command not found

The fist line seems to be ignorable. The second not so much. I changed the script to point to my node (which node) which fixed it

/usr/local/bin/node index.js "$1"

Thanks!

Still Unable to Read Preferences in Alfred 4

Related to #22, but this still seems to be unsolved for me. Despite alfred-link, the install script is still looking for Alfred-Preferences-3.plist. Could this be caused by the fact that I store my Alfred preferences in a different directory (e.g. Dropbox for syncing)?

Error: Command failed: alfred-link
Error: Permission denied to read Alfred preferences at location /Users/ohong/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist
    at module.exports (/Users/ohong/.nvm/versions/node/v12.8.0/lib/node_modules/alfred-emoj/node_modules/resolve-alfred-prefs/index.js:44:9)

    at makeError (/Users/ohong/.nvm/versions/node/v12.8.0/lib/node_modules/alfred-emoj/node_modules/execa/index.js:174:9)
    at /Users/ohong/.nvm/versions/node/v12.8.0/lib/node_modules/alfred-emoj/node_modules/execa/index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:85:5) {
  code: 1,
  stdout: '',
  stderr: 'Error: Permission denied to read Alfred preferences at location /Users/ohong/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist\n' +
    '    at module.exports (/Users/ohong/.nvm/versions/node/v12.8.0/lib/node_modules/alfred-emoj/node_modules/resolve-alfred-prefs/index.js:44:9)\n',
  failed: true,
  signal: null,
  cmd: 'alfred-link',
  timedOut: false,
  killed: false
}

Certificate Expired 😢

I'm getting the following certification expiration error after initially installing the workflow and testing it out in Alfred.

Any thoughts on how I should go about fixing it?

I tried looking at the line where it errored but it wasn't too helpful.

screenshot 2017-07-15 20 01 36

Error message copied below

emoj smileRequestError: certificate has expired 
   at ClientRequest.req.once.err (/usr/local/lib/node_modules/alfred-emoj/node_modules/got/index.js:73:21)

screenshot 2017-07-15 20 01 44

Slow Results

Any ideas on why this Workflow takes so long to return results? For any given query I'm sat waiting for many second:

screencast

The results also don't seem to cache, in the above screencast I make the same search twice.

npm i -g alfred-emoj failed with Alfred 4

Hi,

I had been using alfred-emoj with Alfred 3 for sometime, recently I switched to Alfred 4 after reinstalling my laptop. npm i -g alfred-emoj failed to install with this message:

{ Error: Command failed: alfred-link
Error: Alfred preferences not found at location /Users/mickey/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist
    at pathExists.then.exists (/Users/mickey/.asdf/installs/nodejs/10.16.0/.npm/lib/node_modules/alfred-emoj/node_modules/resolve-alfred-prefs/index.js:15:10)


    at makeError (/Users/mickey/.asdf/installs/nodejs/10.16.0/.npm/lib/node_modules/alfred-emoj/node_modules/execa/index.js:174:9)
    at Promise.all.then.arr (/Users/mickey/.asdf/installs/nodejs/10.16.0/.npm/lib/node_modules/alfred-emoj/node_modules/execa/index.js:278:16)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  code: 1,
  stdout: '',
  stderr:
   'Error: Alfred preferences not found at location /Users/mickey/Library/Preferences/com.runningwithcrayons.Alfred-Preferences-3.plist\n    at pathExists.then.exists (/Users/mickey/.asdf/installs/nodejs/10.16.0/.npm/lib/node_modules/alfred-emoj/node_modules/resolve-alfred-prefs/index.js:15:10)\n',
  failed: true,
  signal: null,
  cmd: 'alfred-link',
  timedOut: false,
  killed: false }

I looked in to my finder and seems like Alfred 4 preference has been renamed from com.runningwithcrayons.Alfred-Preferences-3.plist to com.runningwithcrayons.Alfred-Preferences.plist.

question: update emoji dictionary

it looks like this workflow doesn't really have control over how emoji's are discovered but I figured I would ask since ¯_(ツ)_/¯.

I can't get this emoji 🤞 with the app. fingers, cross, fingers crossed, hand with index and middle fingers crossed, etc.

Can you tell me if there is a route to report and solve these types of issues upstream?

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.