From 1f83bcdbbb16ca8b4b26b8dc3329571f16ab1078 Mon Sep 17 00:00:00 2001 From: MeaTLoTioN Date: Sat, 31 Aug 2024 13:40:44 +0100 Subject: [PATCH] add another populate script --- populate_emojis_2.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 populate_emojis_2.sh diff --git a/populate_emojis_2.sh b/populate_emojis_2.sh new file mode 100755 index 0000000..fd3b45a --- /dev/null +++ b/populate_emojis_2.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Function to add an emoji and its description to the file +function add_emoji { + echo -e "$1 $2" >> emojis.txt + echo -n . +} + +# Create or clear the emojis.txt file +> emojis.txt + +EMOJI_VERSION="latest" +echo "Retrieving version: $EMOJI_VERSION" + +# Process the emojis and descriptions and call the add_emoji function +#curl -s "https://unicode.org/Public/emoji/$EMOJI_VERSION/emoji-test.txt"|grep fully-qualified|sed 's/ ; fully-qualified # //g'|grep -v fully-qualified|while read -r line; do +#curl -s "https://unicode.org/Public/emoji/$EMOJI_VERSION/emoji-test.txt"|grep fully-qualified|grep -oP '#.*'|grep -v fully-qualified|sed 's/^# //g'|while read -r line; do +curl -s "https://unicode.org/Public/emoji/$EMOJI_VERSION/emoji-test.txt"|grep [0-9]|grep -oP '#.*'|sed 's/^# //g'|grep -v ^[0-9a-zA-Z]|while read -r line; do + emoji=$(echo "$line"|awk '{print $1}') + emoji_ver=$(echo "$line"|awk '{print $2}') + description=$(echo "$line"|cut -d' ' -f3-) + add_emoji "$emoji" "$description" +done + +echo -e "\nEmojis file created successfully!" +