Skip to content

Commit

Permalink
feat!: Use emojis-app.com instead of emojisource.app
Browse files Browse the repository at this point in the history
  • Loading branch information
Allaman committed Oct 6, 2024
1 parent bb0a9f6 commit 959ba47
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update-emojis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

- name: fetch json
run: |
curl -sX GET "https://emojisource.app/api/v1/emojis" -H "Authorization: Bearer ${{secrets.EMOJI_SOURCE_TOKEN}}" | jq -r 'map(del(.subgroup, .code_point))' > /tmp/emojis.json
curl -sX GET "https://emoji-api.com/emojis?access_key=${{secrets.EMOJI_SOURCE_TOKEN}}" | jq -r 'map(del(.subGroup, .codePoint))' > /tmp/emojis.json
- name: Set up Python 3.12
uses: actions/setup-python@v5
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Jokes aside, I could not find a plugin that fulfills my wish for both telescope

## 💫 Features

- Automatic updates of available emojis via GitHub actions ([emojisource.app](https://emojisource.app/) as source).
- Automatic updates of available emojis via GitHub actions ([emojis-api.com](https://emoji-api.com/) as source).
- No dependencies (relies on `vim.ui.select`).
- (Optional) [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) integration (emojis only).
- (Optional) [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) integration (emojis only).
Expand Down Expand Up @@ -141,6 +141,6 @@ You can also create key bindings to your liking.

## ♥️ Credits

Thanks to [emojisource.app](https://emojisource.app/) for providing its emoji API that is used in GitHub Actions to automatically update emojis.
Thanks to ([emojis-api.com](https://emoji-api.com/) for providing its emoji API that is used in GitHub Actions to automatically update emojis.

Thanks to [hines-r](https://github.com/hines-r) for providing [kaomojis.json](https://github.com/hines-r/kaomoji-api/blob/master/src/kaomoji.json)
2 changes: 1 addition & 1 deletion lua/data/emojis.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lua/emoji/emoji.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local utils = require("emoji.utils")
---@class EmojiData
---@field slug string
---@field character string
---@field unicode_name string
---@field unicodeName string
---@field group string
local EmojiData

Expand Down
4 changes: 2 additions & 2 deletions lua/emoji/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ UI.select_and_insert = function(emojis)
local emoji_options = {}
for _, e in ipairs(emojis) do
-- handle emojis
if e.unicode_name ~= nil then
table.insert(emoji_options, e.character .. " " .. e.unicode_name)
if e.unicodeName ~= nil then
table.insert(emoji_options, e.character .. " " .. e.unicodeName)
end
-- handle kaomojis
if e.group ~= nil then
Expand Down
2 changes: 1 addition & 1 deletion lua/telescope/_extensions/emoji.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function M.finder()
local emojis = utils.load_from_json(plugin_path .. emoji_path)
local results = {}
for _, e in ipairs(emojis) do
table.insert(results, { name = e.unicode_name, character = e.character, group = e.group })
table.insert(results, { name = e.unicodeName, character = e.character, group = e.group })
end
return finders.new_table({
results = results,
Expand Down
6 changes: 3 additions & 3 deletions tests/emoji/test_data/broken.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
{
"slug": "grinning-face",
"character": "\ud83d\ude00",
"unicode_name": "grinning face",
"code_point": "1F600",
"unicodeName": "grinning face",
"codePoint": "1F600",
"group: "smileys-emotion",
"subgroup": "face-smiling"
"subGroup": "face-smiling"
}
]
12 changes: 6 additions & 6 deletions tests/emoji/test_data/test.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
{
"slug": "grinning-face",
"character": "\ud83d\ude00",
"unicode_name": "grinning face",
"code_point": "1F600",
"unicodeName": "grinning face",
"codePoint": "1F600",
"group": "smileys-emotion",
"subgroup": "face-smiling"
"subGroup": "face-smiling"
},
{
"slug": "grinning-face-with-big-eyes",
"character": "\ud83d\ude03",
"unicode_name": "grinning face with big eyes",
"code_point": "1F603",
"unicodeName": "grinning face with big eyes",
"codePoint": "1F603",
"group": "flags",
"subgroup": "face-smiling"
"subGroup": "face-smiling"
}
]
18 changes: 9 additions & 9 deletions tests/emoji/test_emoji.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ T["load emoji from json"] = function()
local want = {
{
character = "😀",
code_point = "1F600",
codePoint = "1F600",
group = "smileys-emotion",
slug = "grinning-face",
subgroup = "face-smiling",
unicode_name = "grinning face",
subGroup = "face-smiling",
unicodeName = "grinning face",
},
{
character = "😃",
code_point = "1F603",
codePoint = "1F603",
group = "flags",
slug = "grinning-face-with-big-eyes",
subgroup = "face-smiling",
unicode_name = "grinning face with big eyes",
subGroup = "face-smiling",
unicodeName = "grinning face with big eyes",
},
}
eq(want, get)
Expand Down Expand Up @@ -53,11 +53,11 @@ T["filter emoji by group"] = function()
local want = {
{
character = "😃",
code_point = "1F603",
codePoint = "1F603",
group = "flags",
slug = "grinning-face-with-big-eyes",
subgroup = "face-smiling",
unicode_name = "grinning face with big eyes",
subGroup = "face-smiling",
unicodeName = "grinning face with big eyes",
},
}
eq(want, get)
Expand Down

0 comments on commit 959ba47

Please sign in to comment.