Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emoji source host down? #27

Closed
mmccoy opened this issue Aug 31, 2020 · 6 comments · Fixed by #29
Closed

Emoji source host down? #27

mmccoy opened this issue Aug 31, 2020 · 6 comments · Fixed by #29

Comments

@mmccoy
Copy link
Contributor

mmccoy commented Aug 31, 2020

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

@jessedobbelaere
Copy link

jessedobbelaere commented Sep 3, 2020

Yeah still broken indeed :( #26 mentioned it too but it has been a few days now already, does not seem to be a short downtime period, maybe they shut it down for good? In that case we might have to search for a new API, e.g. https://emoji-api.com/ or others

@Bergrebell
Copy link

Bergrebell commented Oct 5, 2020

in case somebody wants to fix it for themself:

  1. go to https://emoji-api.com and obtain an API key
  2. locate the location of the nodeJS script (in alfred -> workflows -> right click on Emoj -> open in finder)
  3. update index.js so that it looks like this
'use strict';
const alfy = require('alfy');

(async () => {
	const data = await alfy.fetch(`https://emoji-api.com/emojis?search=${alfy.input}&access_key=YOUR_API_KEY`);

	let all = '';

	const items = data.map(item => {
		const emoji = item.character;
		all += emoji;

		return {
			title: emoji,
			arg: emoji,
			icon: {
				path: ' ' // Hide icon
			}
		};
	});

	items.push({
		title: all,
		arg: all,
		icon: {
			path: ' '
		}
	});

  alfy.output(items);
})();
  1. replace YOUR_API_KEY with your API key from step 1.

hope that helps :)

@vinkla
Copy link

vinkla commented Jan 15, 2021

I've reached out to the company who runs the API (since I maintained the kaomoji version). This is their statement:

Unfortunately our company is winding down, the emoji and kaomoji api are shutting down. The keyboard Minuum will be spun out but the API are reaching end of life.

@elalemanyo
Copy link

in case somebody wants to fix it for themself:

  1. go to https://emoji-api.com and obtain an API key
  2. locate the location of the nodeJS script (in alfred -> workflows -> right click on Emoj -> open in finder)
  3. update index.js so that it looks like this
'use strict';
const alfy = require('alfy');

(async () => {
	const data = await alfy.fetch(`https://emoji-api.com/emojis?search=${alfy.input}&access_key=YOUR_API_KEY`);

	let all = '';

	const items = data.map(item => {
		const emoji = item.character;
		all += emoji;

		return {
			title: emoji,
			arg: emoji,
			icon: {
				path: ' ' // Hide icon
			}
		};
	});

	items.push({
		title: all,
		arg: all,
		icon: {
			path: ' '
		}
	});

  alfy.output(items);
})();
  1. replace YOUR_API_KEY with your API key from step 1.

hope that helps :)

@Bergrebell thanks for your fix, it works great! But I found that sometimes the data is empty 🤷‍♂️, for example I test it with funny and I don't get any answer... because of that maybe is better to check if data is there?

'use strict';
const alfy = require('alfy');

(async () => {
	const data = await alfy.fetch(`https://emoji-api.com/emojis?search=${alfy.input}&access_key=YOUR_API_KEY`);

	let all = '';

	if (data) {
		const items = data.map(item => {
			const emoji = item.character;
			all += emoji;

			return {
				title: emoji,
				arg: emoji,
				icon: {
					path: ' ' // Hide icon
				}
			};
		});

		items.push({
			title: all,
			arg: all,
			icon: {
				path: ' '
			}
		});

  	alfy.output(items);
  }
})();

@chrisspiegl
Copy link

chrisspiegl commented Dec 29, 2021

@sindresorhus Could this be updated to support a new Emoji API?

@sindresorhus
Copy link
Owner

This project should be changed to depend on https://github.com/sindresorhus/emoj, which does have an alternative emoji source now.

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

Successfully merging a pull request may close this issue.

7 participants