~fgaz/minetest-thirtydollar_emojis

03a2bafd962cd34db3390050644e8309c1c391da — Francesco Gazzetta 11 months ago
🌅
5 files changed, 252 insertions(+), 0 deletions(-)

A .gitignore
A README.md
A download.py
A init.lua
A mod.conf
A  => .gitignore +2 -0
@@ 1,2 @@
/sounds
/textures

A  => README.md +18 -0
@@ 1,18 @@
# `thirtydollar_emojis` Minetest mod

Emojis for `emojis_api` scraped from https://thirtydollar.website

## Installation

Before or after moving the mod to your `mods` directory, you'll have to download
the sounds and images from thirtydollar.website.

In this mod's directory, run this:

```sh
python3 download.py
# If you want ogg (smaller) instead of wav files, install ffmpeg and run this too:
cd sounds
for file in *.wav; do ffmpeg -i "${file}" "${file/%wav/ogg}"; done
rm *.wav
```

A  => download.py +26 -0
@@ 1,26 @@
#!/usr/bin/env python3

from urllib.request import urlopen, urlretrieve
import json
import os

mappings = json.load(urlopen("https://thirtydollar.website/sounds.json"))

os.mkdir("sounds")
os.mkdir("textures")

for mapping in mappings:
    ident = mapping["id"]
    if ident == "_pause": continue
    print("Downloading", ident)
    soundURL = f"https://thirtydollar.website/sounds/thirtydollar_emojis_{ident}.wav"
    print("Downloading", soundURL)
    urlretrieve(soundURL, filename=f"sounds/{ident}.wav")
    if "emoji" in mapping:
        emoji = ord(mapping["emoji"][0])
        imageURL = f"https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/72x72/{emoji:x}.png"
    else: # actually x.id.match(/[a-z0-9]/i))
        name = mapping["img"] if "img" in mapping else ident
        imageURL = f"https://thirtydollar.website/icons/{name}.png"
    print("Downloading", imageURL)
    urlretrieve(imageURL, filename=f"textures/thirtydollar_emojis_{ident}.png")

A  => init.lua +203 -0
@@ 1,203 @@
-- To regenerate the table, run
--     curl https://thirtydollar.website/sounds.json | jq 'map(.id)'
-- then remove "_pause" and change [] to {}
local names = {
  "boom",
  "bruh",
  "bong",
  "skeleton",
  "clap",
  "dog",
  "cave",
  "bell",
  "boink",
  "fart",
  "error",
  "kaching",
  "bonk",
  "bleep",
  "alarm",
  "buzzer",
  "aah",
  "e",
  "eight",
  "pizza",
  "augh",
  "quack",
  "honk",
  "samsung",
  "morningflower",
  "hitmarker",
  "noice",
  "slap",
  "krabs",
  "wowowow",
  "whatsapp",
  "suspense",
  "alert",
  "slip",
  "explosion",
  "tada",
  "pan",
  "recordscratch",
  "airhorn",
  "taiko_don",
  "taiko_ka",
  "dimrainsynth",
  "robtopphone",
  "waterphone",
  "slapbass",
  "hoenn",
  "zunpet",
  "gun",
  "dodgeball",
  "whipcrack",
  "gnome",
  "nope",
  "mrbeast",
  "obama",
  "op",
  "SLAM",
  "stopposting",
  "21",
  "americano",
  "oof",
  "subaluwa",
  "necoarc",
  "samurai",
  "flipnote",
  "familyguy",
  "pingas",
  "yoda",
  "hehehehaw",
  "ultrainstinct",
  "granddad",
  "morshu",
  "smw_coin",
  "smw_1up",
  "smw_spinjump",
  "smw_stomp2",
  "smw_kick",
  "smw_stomp",
  "yahoo",
  "sm64_hurt",
  "thwomp",
  "bup",
  "sm64_painting",
  "smm_scream",
  "mariopaint_mario",
  "mariopaint_luigi",
  "smw_yoshi",
  "mariopaint_star",
  "mariopaint_flower",
  "mariopaint_gameboy",
  "mariopaint_dog",
  "mariopaint_cat",
  "mariopaint_swan",
  "mariopaint_baby",
  "mariopaint_plane",
  "mariopaint_car",
  "shaker",
  "kick",
  "hammer",
  "tom",
  "sidestick",
  "ride2",
  "buttonpop",
  "skipshot",
  "otto_on",
  "otto_off",
  "otto_happy",
  "otto_stress",
  "tab_sounds",
  "tab_rows",
  "tab_actions",
  "tab_decorations",
  "tab_rooms",
  "preecho",
  "tonk",
  "rdclap",
  "rdmistake",
  "midspin",
  "adofai_fire",
  "adofai_ice",
  "adofaikick",
  "adofaicymbal",
  "cowbell",
  "karateman_throw",
  "karateman_offbeat",
  "karateman_hit",
  "karateman_bulb",
  "ook",
  "choruskid",
  "builttoscale",
  "perfectfail",
  "skillstar",
  "fnf_left",
  "fnf_down",
  "fnf_up",
  "fnf_right",
  "fnf_death",
  "gdcrash",
  "gdcrash_orbs",
  "gd_coin",
  "gd_orbs",
  "gd_diamonds",
  "gd_quit",
  "bwomp",
  "undertale_hit",
  "undertale_crack",
  "sans_voice",
  "megalovania",
  "megalovania_note",
  "undertale_encounter",
  "toby",
  "gaster",
  "lancersplat",
  "isaac_hurt",
  "isaac_dead",
  "isaac_mantle",
  "BABA",
  "YOU",
  "DEFEAT",
  "vvvvvv_flip",
  "vvvvvv_hurt",
  "vvvvvv_checkpoint",
  "vvvvvv_flash",
  "terraria_star",
  "terraria_pot",
  "terraria_reforge",
  "terraria_guitar",
  "terraria_axe",
  "celeste_dash",
  "celeste_death",
  "celeste_spring",
  "celeste_diamond",
  "amogus_emergency",
  "amogus_kill",
  "amongus",
  "amongdrip",
  "amogus",
  "minecraft_explosion",
  "minecraft_anvil",
  "minecraft_bell",
  "noteblock_harp",
  "noteblock_bass",
  "noteblock_snare",
  "noteblock_click",
  "noteblock_bell",
  "noteblock_banjo",
  "noteblock_bit",
  "noteblock_chime",
  "noteblock_xylophone",
  "noteblock_guitar",
  "noteblock_flute",
  "noteblock_pling"
}

for _,name in ipairs(names) do
  emojis_api.register_emoji(
    "thirtydollar_emojis_" .. name,
    "thirtydollar_emojis_" .. name .. ".png",
    "thirtydollar_emojis_" .. name)
end

A  => mod.conf +3 -0
@@ 1,3 @@
name = thirtydollar_emojis
description = An emoji pack for emojis_api, generated from thirtydollar.website
depends = emojis_api