Skip to content

Package written in Go to get, return, treat and manage emojis โ›‘ ๐Ÿชฑ ๐Ÿ’ฅ ๐Ÿต๏ธ ๐Ÿ‡ณ๐Ÿ‡บ ๐Ÿ’พ ๐ŸŸ๏ธ ๐Ÿซ ๐Ÿ’ฆ ๐Ÿฆญ๐Ÿฝ ๐Ÿ”ฑ ๐Ÿฆ‹ ๐Ÿ“Œ ๐Ÿ‘น โ™จ๏ธ ๐Ÿ‡ณ๐Ÿ‡ท ๐Ÿ“ ๐Ÿคฌ ๐Ÿ ๐Ÿˆ โšœ๏ธ ๐Ÿ”ซ ๐Ÿš„ โค๏ธโ€๐Ÿฉน ๐ŸŒ‹ ๐ŸŽ“ ๐Ÿ’ˆ ๐ŸŽƒ ๐Ÿฅ‘ ๐Ÿ˜ˆ ๐Ÿฅฅ ๐Ÿ˜ธ ๐Ÿพ ๐Ÿฅต โ™ป๏ธ ๐Ÿฆพ ๐Ÿ™€ ๐ŸŽ—๏ธ โ˜ ๏ธ ๐Ÿซ€ ๐Ÿ‘ป ๐Ÿ‡ฐ๐Ÿ‡ต ๐Ÿซ ๐Ÿ—พ ๐Ÿ—๏ธ ๐Ÿคข ๐Ÿ”• ๐Ÿง ๐Ÿ‘ฝ ๐Ÿช” ๐ŸŒน ๐Ÿช™ โš•๏ธ๐Ÿ›Ž๏ธ ๐Ÿ’ฉ ๐Ÿก ๐Ÿ™ ๐Ÿ˜ป ๐Ÿงณ ๐ŸŽฅ ๐Ÿ’ป ๐Ÿฅถ ๐Ÿ”˜ ๐Ÿ–ฅ๏ธ ๐Ÿ”ฎ ๐Ÿณ ๐Ÿ•ณ๏ธ ๐Ÿ’ฏ ๐Ÿ’ซ ๐Ÿช ๐Ÿงจ ๐Ÿ—บ๏ธ ๐Ÿ‡จ๐Ÿ‡บ ๐Ÿฆฃ ๐Ÿฆˆ ๐Ÿฒ ๐Ÿงฑ ๐Ÿณ ๐Ÿ‡จ๐Ÿ‡ผ โ›ฉ๏ธ ๐Ÿคฏ ๐ŸŒก๏ธ ๐Ÿฅฉ ๐Ÿ‘บ ๐Ÿ“Ž ๐Ÿ’ณ ๐Ÿฆง ๐ŸŽณ ๐Ÿงถ ๐Ÿ›๏ธ ๐Ÿง  ๐Ÿฅ€ ๐Ÿ›‘ โœ”๏ธ ๐Ÿฌ ๐Ÿ‡ฎ๐Ÿ‡ฒ ๐Ÿ”ฅ from the Open Emoji API in every Go project...

License

Notifications You must be signed in to change notification settings

Vicken-Ghoubiguian/emojis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

emojis

Package written in Go to get, return, treat and manage emojis โ›‘ ๐Ÿชฑ ๐Ÿ’ฅ ๐Ÿต๏ธ ๐Ÿ‡ณ๐Ÿ‡บ ๐Ÿ’พ ๐ŸŸ๏ธ ๐Ÿซ ๐Ÿ’ฆ ๐Ÿฆญ๐Ÿฝ ๐Ÿ”ฑ ๐Ÿฆ‹ ๐Ÿ“Œ ๐Ÿ‘น โ™จ๏ธ ๐Ÿ‡ณ๐Ÿ‡ท ๐Ÿ“ ๐Ÿคฌ ๐Ÿ ๐Ÿˆ โšœ๏ธ ๐Ÿ”ซ ๐Ÿš„ โค๏ธโ€๐Ÿฉน ๐ŸŒ‹ ๐ŸŽ“ ๐Ÿ’ˆ ๐ŸŽƒ ๐Ÿฅ‘ ๐Ÿ˜ˆ ๐Ÿฅฅ ๐Ÿ˜ธ ๐Ÿพ ๐Ÿฅต โ™ป๏ธ ๐Ÿฆพ ๐Ÿ™€ ๐ŸŽ—๏ธ โ˜ ๏ธ ๐Ÿซ€ ๐Ÿ‘ป ๐Ÿ‡ฐ๐Ÿ‡ต ๐Ÿซ ๐Ÿ—พ ๐Ÿ—๏ธ ๐Ÿคข ๐Ÿ”• ๐Ÿง ๐Ÿ‘ฝ ๐Ÿช” ๐ŸŒน ๐Ÿช™ โš•๏ธ๐Ÿ›Ž๏ธ ๐Ÿ’ฉ ๐Ÿก ๐Ÿ™ ๐Ÿ˜ป ๐Ÿงณ ๐ŸŽฅ ๐Ÿ’ป ๐Ÿฅถ ๐Ÿ”˜ ๐Ÿ–ฅ๏ธ ๐Ÿ”ฎ ๐Ÿณ ๐Ÿ•ณ๏ธ ๐Ÿ’ฏ ๐Ÿ’ซ ๐Ÿช ๐Ÿงจ ๐Ÿ—บ๏ธ ๐Ÿ‡จ๐Ÿ‡บ ๐Ÿฆฃ ๐Ÿฆˆ ๐Ÿฒ ๐Ÿงฑ ๐Ÿณ ๐Ÿ‡จ๐Ÿ‡ผ โ›ฉ๏ธ ๐Ÿคฏ ๐ŸŒก๏ธ ๐Ÿฅฉ ๐Ÿ‘บ ๐Ÿ“Ž ๐Ÿ’ณ ๐Ÿฆง ๐ŸŽณ ๐Ÿงถ ๐Ÿ›๏ธ ๐Ÿง  ๐Ÿฅ€ ๐Ÿ›‘ โœ”๏ธ ๐Ÿฌ ๐Ÿ‡ฎ๐Ÿ‡ฒ ๐Ÿ”ฅ from the Open Emoji API in every Go project...

Contents

Introduction

Presentation

So this golang package allows you to do the following things with emojis:

  • collect all the existing emojis,
  • collect all emojis belonging to a specific category,
  • collect all emojis belonging to a specific sub-category,
  • get the emoji from its code point (),
  • get all the existing emoji categories with the corresponding sub-categories,
  • do different kinds of sorting on emojis (),
  • do various statistical calculations on emojis ().

Project's structure

How was this project developed ?

How to use this package ?

The emojis Go package can be used in every Go project you develop. However, you can use it only in Go projects. To do it, you must execute this command to install the emojis golang package:

go get -u github.com/Vicken-Ghoubiguian/emojis

This command will download, from its GitHub repository, and install, on your local machine, the emojis Go package. You can use it in any directory and Go file in your file system tree... To know how to use this Go package, please take a look at the examples below...

Little examples

Below are the examples that show how to use, in details, all the functions of this package:

Example 1 - Get and display the data of all emojis...

package main

import (
	
	"fmt"
	"github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

	// Declaration and initialization of the 'allEmojisListOfEmojis' variable which will contain all existing emojis...
	allEmojisListOfEmojis := emojis.GetAllEmojis("<Your_access_key>")

	// Display a separator...
	fmt.Println("\n==================================\n")

	// Defining the loop to display datas of all existing emojis...
	for _, emoji := range allEmojisListOfEmojis.GetListOfEmojis() {

		// Display the current emoji...
		fmt.Println(emoji.ToString())

		// Break one line...
		fmt.Println("\n")
	}

	// Display a separator...
	fmt.Println("\n==================================\n")
}

Example 2 - Get and display the data of one specific emoji...

package main

import (
	
	"fmt"
	"github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

	// Declaration and initialization of the 'anatomicalHeartEmoji' variable which will contain the 'anatomical heart' emoji...
	anatomicalHeartEmoji := emojis.GetASingleEmoji("anatomical-heart", "<Your_access_key>")

	// Display a separator...
    fmt.Println("\n==================================\n")

	// Display the 'anatomical heart' emoji...
	fmt.Println(anatomicalHeartEmoji.ToString())

	// Display a separator...
    fmt.Println("\n==================================\n")
}

Example 3 - Get and display the data of all emojis from a specific category (1)...

package main

import (

        "fmt"
        "github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

        // Declaration and initialization of the 'allEmojisListOfEmojis' variable which will contain all existing emojis...
        allEmojisListOfEmojis := emojis.GetAllEmojis("<Your_access_key>")

        // Declaration and initialization of the 'allSmileysEmojisListOfEmojis' variable which will contain all existing emojis of the 'smileys-emotion' category...
        allSmileysEmojisListOfEmojis := allEmojisListOfEmojis.GetEmojisFromGroup("smileys-emotion")

		// Display a separator...
		fmt.Println("\n==================================\n")

		// Defining the loop to display datas of all existing emojis of the 'smileys-emotion' category...
		for _, emoji := range allSmileysEmojisListOfEmojis.GetListOfEmojis() {

			// Display the current emoji...
			fmt.Println(emoji.ToString())

			// Break one line...
			fmt.Println("\n")
		}

		// Display a separator...
		fmt.Println("\n==================================\n")
}

Example 4 - Get and display the data of all emojis from a specific sub group...

package main

import (

        "fmt"
        "github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

	// Declaration and initialization of the 'allEmojisListOfEmojis' variable which will contain all existing emojis...
    allEmojisListOfEmojis := emojis.GetAllEmojis("<Your_access_key>")

    // Declaration and initialization of the 'allCatFacesEmojisListOfEmojis' variable which will contain all existing emojis of the 'cat-face' sub category...
    allCatFacesEmojisListOfEmojis := allEmojisListOfEmojis.GetEmojisFromSubGroup("cat-face")

	// Display a separator...
	fmt.Println("\n==================================\n")

	// Defining the loop to display datas of all existing emojis of the 'cat-face' sub category...
	for _, emoji := range allCatFacesEmojisListOfEmojis.GetListOfEmojis() {

		// Display the current emoji...
		fmt.Println(emoji.ToString())

		// Break one line...
		fmt.Println("\n")
	}

	// Display a separator...
	fmt.Println("\n==================================\n")
}

Example 5 - Get and display the data of all emojis from a specific category (2)...

package main

import (

        "fmt"
        "github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

    // Declaration and initialization of the 'allSmileysEmojisListOfEmojis' variable which will contain all existing emojis of the 'smileys-emotion' category...
    allSmileysEmojisListOfEmojis := emojis.GetInCategoryEmojis("smileys-emotion", "<Your_access_key>")

	// Display a separator...
	fmt.Println("\n==================================\n")

	// Defining the loop to display datas of all existing emojis of the 'smileys-emotion' category...
	for _, emoji := range allSmileysEmojisListOfEmojis.GetListOfEmojis() {

			// Display the current emoji...
			fmt.Println(emoji.ToString())

			// Break one line...
			fmt.Println("\n")
		}

		// Display a separator...
		fmt.Println("\n==================================\n")
}

Example 6 - Get and display the data of all emojis attached to a particular string...

package main

import (

        "fmt"
        "github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

	// Declaration and initialization of the 'allSearchForCatListOfEmojis' variable which will contain all existing emojis all existing emojis attached to the string 'cat'...
    allSearchForCatListOfEmojis := emojis.GetSearchedForEmojis("cat", "<Your_access_key>")

	// Display a separator...
	fmt.Println("\n==================================\n")

	// Defining the loop to display datas of all existing emojis attached to the string 'cat'...
	for _, emoji := range allSearchForCatListOfEmojis.GetListOfEmojis() {

		// Display the current emoji...
		fmt.Println(emoji.ToString())

		// Break one line...
		fmt.Println("\n")
	}

	// Display a separator...
	fmt.Println("\n==================================\n")
}

Example 7

package main

import (

        "fmt"
        "github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

        // Declaration and initialization of the 'allEmojisListOfEmojis' variable which will contain all existing emojis...
        allEmojisListOfEmojis := emojis.GetAllEmojis("<Your_access_key>")

        // Initialization of the 'anatomicalHeartEmoji' variable which will contain the 'anatomical heart' emoji...
        anatomicalHeartEmoji := allEmojisListOfEmojis.GetASingleEmoji("anatomical-heart")

        // Display a separator...
        fmt.Println("\n==================================\n")

        // Display the 'anatomical heart' emoji...
        fmt.Println(anatomicalHeartEmoji.ToString())

        // Display a separator...
        fmt.Println("\n==================================\n")
}

Example 8 - Get and display the data of all emojis attached to a particular string...

package main

import (

        "fmt"
        "github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

        // Declaration and initialization of the 'allEmojisListOfEmojis' variable which will contain all existing emojis...
        allEmojisListOfEmojis := emojis.GetAllEmojis("<Your_access_key>")

		// Declaration and initialization of the 'allSearchForCatListOfEmojis' variable which will contain all existing emojis all existing emojis attached to the string 'cat'...
		allSearchForCatListOfEmojis := allEmojisListOfEmojis.GetSearchedForEmojis("cat")

		// Display a separator...
		fmt.Println("\n==================================\n")

		// Defining the loop to display datas of all existing emojis attached to the string 'cat'...
		for _, emoji := range allSearchForCatListOfEmojis.GetListOfEmojis() {

			// Display the current emoji...
			fmt.Println(emoji.ToString())

			// Break one line...
			fmt.Println("\n")
		}

		// Display a separator...
		fmt.Println("\n==================================\n")
}

Example 9

package main

import (

        "fmt"
        "github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

    // Declaration and initialization of the 'allCatFacesEmojisListOfEmojis' variable which will contain all existing emojis of the 'cat-face' sub category...
    allCatFacesEmojisListOfEmojis := emojis.GetEmojisFromSubGroup("cat-face", "<Your_access_key>")

	// Display a separator...
	fmt.Println("\n==================================\n")

	// Defining the loop to display datas of all existing emojis of the 'cat-face' sub category...
	for _, emoji := range allCatFacesEmojisListOfEmojis.GetListOfEmojis() {

		// Display the current emoji...
		fmt.Println(emoji.ToString())

		// Break one line...
		fmt.Println("\n")
	}

	// Display a separator...
	fmt.Println("\n==================================\n")
}

Example 10

package main

import (

        "fmt"
		"strings"
		"strconv"
        "github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

	// Declaration and initialization of the 'allEmojisCategories' variable which will contain all existing emojis categories...
	allEmojisCategories := emojis.GetAllCategories("<Your_access_key>")

	// Display a separator...
	fmt.Println("\n==================================\n")

	// Defining the loop to display datas of all existing emojis categories...
	for _, category := range allEmojisCategories.GetMapOfCategories() {

		// Display datas of the current emojis categories...
		fmt.Println("Slug: " + category.GetSlug())
		fmt.Println("Sub categories array: " + "[" + strings.Join(category.GetSubCategoriesArray(), ", ") + "]")
		fmt.Println("Sub categories account: ", strconv.Itoa(category.GetSubCategoriesAccount()))

		// Break one line...
		fmt.Println("\n")
	}

	// Display a separator...
	fmt.Println("\n==================================\n")
}

Example 11

package main

import (

        "fmt"
        "github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

        // Declaration and initialization of the 'allEmojisListOfEmojis' variable which will contain all existing emojis...
        allEmojisListOfEmojis := emojis.GetAllEmojis("<Your_access_key>")

        // Display a separator...
        fmt.Println("\n==================================\n")

        // Display all of the emojis in the 'allEmojisListOfEmojis' ListOfEmojis in an alphabetical order...
        allEmojisListOfEmojis.SortAlphabetically()

        // Display a separator...
        fmt.Println("\n==================================\n")
}

Example 12

package main

import (

        "fmt"
        "github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

        // Declaration and initialization of the 'allEmojisListOfEmojis' variable which will contain all existing emojis...
        allEmojisListOfEmojis := emojis.GetAllEmojis("<Your_access_key>")

        // Display a separator...
        fmt.Println("\n==================================\n")

        // Display all of the emojis in the 'allEmojisListOfEmojis' ListOfEmojis in a reverse alphabetical order...
        allEmojisListOfEmojis.SortReverseAlphabetically()

        // Display a separator...
        fmt.Println("\n==================================\n")
}

Example 13 - Get a list of all emojis and display the corresponding percentage for each category...

package main

import (

        "fmt"
        "github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

        // Declaration and initialization of the 'allEmojisListOfEmojis' variable which will contain all existing emojis...
        allEmojisListOfEmojis := emojis.GetAllEmojis("<Your_access_key>")

        // Declaration and initialization of the 'allEmojisCategories' variable which will contain all existing emojis categories...
        allEmojisCategories := emojis.GetAllCategories("<Your_access_key>")

        // Declaration and initialization of the 'allEmojisCategories' variable which will contain all existing emojis categories...
        allEmojisCategoriesMap := allEmojisCategories.GetMapOfCategories()

        // Get all emojis categories in each specific variable...
        catg_1 := allEmojisCategoriesMap["smileys-emotion"]
        catg_2 := allEmojisCategoriesMap["people-body"]
        catg_3 := allEmojisCategoriesMap["component"]
        catg_4 := allEmojisCategoriesMap["animals-nature"]
        catg_5 := allEmojisCategoriesMap["food-drink"]
        catg_6 := allEmojisCategoriesMap["travel-places"]
        catg_7 := allEmojisCategoriesMap["activities"]
        catg_8 := allEmojisCategoriesMap["objects"]
        catg_9 := allEmojisCategoriesMap["symbols"]
        catg_10 := allEmojisCategoriesMap["flags"]

		// Display a separator...
        fmt.Println("\n==================================\n")

        // Display all calculated percentage for each emojis category...
        fmt.Printf("'smileys-emotion' emojis: %f %%\n", catg_1.GetPercentageInListOfEmojis(allEmojisListOfEmojis))
		fmt.Printf("'people-body' emojis: %f %%\n", catg_2.GetPercentageInListOfEmojis(allEmojisListOfEmojis))
		fmt.Printf("'component' emojis: %f %%\n", catg_3.GetPercentageInListOfEmojis(allEmojisListOfEmojis))
		fmt.Printf("'animals-nature' emojis: %f %%\n", catg_4.GetPercentageInListOfEmojis(allEmojisListOfEmojis))
		fmt.Printf("'food-drink' emojis: %f %%\n", catg_5.GetPercentageInListOfEmojis(allEmojisListOfEmojis))
		fmt.Printf("'travel-places' emojis: %f %%\n", catg_6.GetPercentageInListOfEmojis(allEmojisListOfEmojis))
		fmt.Printf("'activities' emojis: %f %%\n", catg_7.GetPercentageInListOfEmojis(allEmojisListOfEmojis))
		fmt.Printf("'objects' emojis: %f %%\n", catg_8.GetPercentageInListOfEmojis(allEmojisListOfEmojis))
		fmt.Printf("'symbols' emojis: %f %%\n", catg_9.GetPercentageInListOfEmojis(allEmojisListOfEmojis))
		fmt.Printf("'flags' emojis: %f %%\n", catg_10.GetPercentageInListOfEmojis(allEmojisListOfEmojis))

		// Display a separator...
        fmt.Println("\n==================================\n")
}

Example 14 - Check if an emoji is in a list of emojis...

package main

import (

        "fmt"
        "strconv"
        "github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

        // Declaration and initialization of the 'allSearchForCatListOfEmojis' variable which will contain all existing emojis attached to the string 'cat'...
        allSearchForCatListOfEmojis := emojis.GetSearchedForEmojis("cat", "<Your_access_key>")

		// Declaration and initialization of the 'allEmojisListOfEmojis' variable which will contain all existing emojis...
        allEmojisListOfEmojis := emojis.GetAllEmojis("<Your_access_key>")

        // Get the 'japanese-application-button' emoji...
        japaneseApplicationButtonEmoji := allSearchForCatListOfEmojis.GetASingleEmoji("japanese-application-button")

        // Initialization of the 'ZzzEmoji' variable which will contain the 'zzz' emoji...
        ZzzEmoji := allEmojisListOfEmojis.GetASingleEmoji("zzz")

        // Display a separator...
        fmt.Println("\n==================================\n")

        // Display if the 'japanese-application-button' emoji is contained in the 'allSearchForCatListOfEmojis' list of emojis...
        fmt.Println("Is the 'japanese-application-button' emoji contained in the cat's list of emojis ? " + strconv.FormatBool(allSearchForCatListOfEmojis.Contains(japaneseApplicationButtonEmoji)) + "\n")

        // Display if the 'zzz' emoji is contained in the 'allSearchForCatListOfEmojis' list of emojis...
        fmt.Println("Is the 'zzz' emoji contained in the cat's list of emojis ? " + strconv.FormatBool(allSearchForCatListOfEmojis.Contains(ZzzEmoji)))

        // Display a separator...
        fmt.Println("\n==================================\n")
}

Example 15 - Get all datas of all emojis and use them in a displayed text...

package main

import (
	
	"fmt"
	"github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

	// Declaration and initialization of the 'allEmojisListOfEmojis' variable which will contain all existing emojis...
	allEmojisListOfEmojis := emojis.GetAllEmojis("<Your_access_key>")

	// Get a list of all emojis as a map[string]Emoji...
	allEmojisMapOfEmojis := allEmojisListOfEmojis.GetListOfEmojis()

	// Get all necessary emojis...
	grinningCatEmoji := allEmojisMapOfEmojis["grinning-cat"]
	foldedHandsEmoji := allEmojisMapOfEmojis["folded-hands"]
	smilingCatWithHeartEyesEmoji := allEmojisMapOfEmojis["smiling-cat-with-heart-eyes"]

	// Display a separator...
    fmt.Println("\n==================================\n")
	
	// Display the text with emojis...
	fmt.Println("Hello world " + grinningCatEmoji.GetCharacter() + "! Welcome to my awesome go package " + foldedHandsEmoji.GetCharacter() + smilingCatWithHeartEyesEmoji.GetCharacter() + "...")

	// Display a separator...
    fmt.Println("\n==================================\n")
}

Example 16 - Delete an emoji from a list of emojis...

package main

import (

        "fmt"
        "github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

        // Declaration and initialization of the 'allSearchForCatListOfEmojis' variable which will contain all existing emojis attached to the string 'cat'...
        allSearchForCatListOfEmojis := emojis.GetSearchedForEmojis("cat", "<Your_access_key>")

        // Get the 'japanese-application-button' emoji which will be deleted from the 'allSearchForCatListOfEmojis' because it has nothing to do with cats...
        japaneseApplicationButtonEmoji := allSearchForCatListOfEmojis.GetASingleEmoji("japanese-application-button")

        // Delete the 'japaneseApplicationButtonEmoji' emoji from the 'allSearchForCatListOfEmojis' list of emojis...
        allSearchForCatListOfEmojis.Delete(japaneseApplicationButtonEmoji)

        // Display a separator...
        fmt.Println("\n==================================\n")

        // Defining the loop to display datas of all existing emojis attached to the string 'cat'...
        for _, emoji := range allSearchForCatListOfEmojis.GetListOfEmojis() {

                // Display datas of the current emojis...
                fmt.Println(emoji.ToString())

                // Break one line...
                fmt.Println("\n")
        }

        // Display a separator...
        fmt.Println("\n==================================\n")
}

Example 17 - Add an emoji to a list of emojis...

package main

import (

        "fmt"
        "github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

        // Declaration and initialization of the 'allEmojisListOfEmojis' variable which will contain all existing emojis...
        allEmojisListOfEmojis := emojis.GetAllEmojis("<Your_access_key>")

        // Declaration and initialization of the 'allSmileysEmojisListOfEmojis' variable which will contain all existing emojis of the 'smileys-emotion' category...
        allSmileysEmojisListOfEmojis := allEmojisListOfEmojis.GetEmojisFromGroup("smileys-emotion")

		// Initialization of the 'anatomicalHeartEmoji' variable which will contain the 'anatomical heart' emoji...
        anatomicalHeartEmoji := allEmojisListOfEmojis.GetASingleEmoji("anatomical-heart")

		// Add the 'anatomicalHeartEmoji' to the 'allSmileysEmojisListOfEmojis' list of emojis...
        allSmileysEmojisListOfEmojis.Add(anatomicalHeartEmoji)

		// Display a separator...
        fmt.Println("\n==================================\n")

        // Defining the loop to display datas of all existing emojis of the 'smileys-emotion' category...
        for _, emoji := range allSmileysEmojisListOfEmojis.GetListOfEmojis() {

                // Display datas of the current emojis...
                fmt.Println(emoji.ToString())

                // Break one line...
                fmt.Println("\n")
        }

        // Display a separator...
        fmt.Println("\n==================================\n")
}

Example 18

package main

import (

        "fmt"
        "github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

        // Declaration and initialization of the 'allEmojisListOfEmojis' variable which will contain all existing emojis...
        allEmojisListOfEmojis := emojis.GetAllEmojis("<Your_access_key>")

        // Declaration and initialization of the 'allSmileysEmojisListOfEmojis' variable which will contain all existing emojis of the 'smileys-emotion' category...
        allSmileysEmojisListOfEmojis := allEmojisListOfEmojis.GetEmojisFromGroup("smileys-emotion")

        // Declaration and initialization of the 'allComputersEmojisListOfEmojis' variable which will contain all existing emojis of the 'computer' category...
        allComputersEmojisListOfEmojis := allEmojisListOfEmojis.GetEmojisFromGroup("computer")

        // Initialization of the 'anatomicalHeartEmoji' variable which will contain the 'anatomical heart' emoji...
        anatomicalHeartEmoji := allEmojisListOfEmojis.GetASingleEmoji("anatomical-heart")

        // Initialization of the 'ZzzEmoji' variable which will contain the 'zzz' emoji...
        ZzzEmoji := allEmojisListOfEmojis.GetASingleEmoji("zzz")

        // Add the 'anatomicalHeartEmoji' to the 'allSmileysEmojisListOfEmojis' list of emojis...
        allSmileysEmojisListOfEmojis.Add(anatomicalHeartEmoji)

        // Add the 'ZzzEmoji' to the 'allSmileysEmojisListOfEmojis' list of emojis...
        allSmileysEmojisListOfEmojis.Add(ZzzEmoji)

        // Add the 'anatomicalHeartEmoji' to the 'allComputersEmojisListOfEmojis' list of emojis...
        allComputersEmojisListOfEmojis.Add(anatomicalHeartEmoji)

        // Add the 'ZzzEmoji' to the 'allComputersEmojisListOfEmojis' list of emojis...
        allComputersEmojisListOfEmojis.Add(ZzzEmoji)

        // Determine the intersection between the 'allFacesEmojisListOfEmojis' set and the 'allEmojisListOfEmojis' set...
        intersectionListOfEmojis := allSmileysEmojisListOfEmojis.Intersection(allComputersEmojisListOfEmojis)

        // Display a separator...
        fmt.Println("\n==================================\n")

		// Display some explanations...
		fmt.Println("All_smileys_emojis_set โŠ‚ All_computers_emojis_set = ")

        // Display the intersection as the 'intersectionListOfEmojis' list of emojis...
		fmt.Println(intersectionListOfEmojis)

        // Display a separator...
        fmt.Println("\n==================================\n")
}

Example 19

package main

import (
	
	"fmt"
	"github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

	// Declaration and initialization of the 'allEmojisListOfEmojis' variable which will contain all existing emojis...
	allEmojisListOfEmojis := emojis.GetAllEmojis("<Your_access_key>")

	// Declaration and initialization of the 'allFacesEmojisListOfEmojis' variable which will contain all existing emojis all existing emojis attached to the string 'face'...
    allFacesEmojisListOfEmojis := allEmojisListOfEmojis.GetSearchedForEmojis("face")

	// Determine the intersection between the 'allFacesEmojisListOfEmojis' set and the 'allEmojisListOfEmojis' set...
	intersectionListOfEmojis := allFacesEmojisListOfEmojis.Intersection(allEmojisListOfEmojis)

	// Display a separator...
    fmt.Println("\n==================================\n")

	// Display some explanations...
	fmt.Println("All_faces_emojis_set โŠ‚ All_emojis_set = ")

	// Display the intersection as the 'intersectionListOfEmojis' list of emojis...
	fmt.Println(intersectionListOfEmojis)

	// Display a separator...
    fmt.Println("\n==================================\n")
}

Example 20 - Check if an emoji belong to a list of emojis...

Example 21 -

package main

import (

        "fmt"
        "github.com/Vicken-Ghoubiguian/emojis"
)

// Definition of the main function...
func main() {

        // Declaration and initialization of the 'allEmojisListOfEmojis' variable which will contain all existing emojis...
        allEmojisListOfEmojis := emojis.GetAllEmojis("<Your_access_key>")

        // Declaration and initialization of the 'allSmileysEmojisListOfEmojis' variable which will contain all existing emojis of the 'cat-face' subcategory...
        allCatFaceEmojisListOfEmojis := allEmojisListOfEmojis.GetEmojisFromSubGroup("cat-face")

        // Declaration and initialization of the 'allComputersEmojisListOfEmojis' variable which will contain all existing emojis of the 'computer' subcategory...
        allComputersEmojisListOfEmojis := allEmojisListOfEmojis.GetEmojisFromSubGroup("computer")

        // Declaration of the 'cartesianProduct' variable which will contain the cartesian product of both 'allCatFaceEmojisListOfEmojis' and 'allComputersEmojisListOfEmojis' set...
        var cartesianProduct emojis.CartesianProductEmojis

        // Initialization and calculation of the cartesian product of both 'allCatFaceEmojisListOfEmojis' and 'allComputersEmojisListOfEmojis' set...
        cartesianProduct.InitializeCartesianProductEmojis(allCatFaceEmojisListOfEmojis, allComputersEmojisListOfEmojis)

        // Display the 'cartesianProduct' CartesianProductEmojis as a string...
        fmt.Println(cartesianProduct.ToString())
}

Where to use it ?

Coming soon...

Useful links

Conclusion

Comming soon...

About

Package written in Go to get, return, treat and manage emojis โ›‘ ๐Ÿชฑ ๐Ÿ’ฅ ๐Ÿต๏ธ ๐Ÿ‡ณ๐Ÿ‡บ ๐Ÿ’พ ๐ŸŸ๏ธ ๐Ÿซ ๐Ÿ’ฆ ๐Ÿฆญ๐Ÿฝ ๐Ÿ”ฑ ๐Ÿฆ‹ ๐Ÿ“Œ ๐Ÿ‘น โ™จ๏ธ ๐Ÿ‡ณ๐Ÿ‡ท ๐Ÿ“ ๐Ÿคฌ ๐Ÿ ๐Ÿˆ โšœ๏ธ ๐Ÿ”ซ ๐Ÿš„ โค๏ธโ€๐Ÿฉน ๐ŸŒ‹ ๐ŸŽ“ ๐Ÿ’ˆ ๐ŸŽƒ ๐Ÿฅ‘ ๐Ÿ˜ˆ ๐Ÿฅฅ ๐Ÿ˜ธ ๐Ÿพ ๐Ÿฅต โ™ป๏ธ ๐Ÿฆพ ๐Ÿ™€ ๐ŸŽ—๏ธ โ˜ ๏ธ ๐Ÿซ€ ๐Ÿ‘ป ๐Ÿ‡ฐ๐Ÿ‡ต ๐Ÿซ ๐Ÿ—พ ๐Ÿ—๏ธ ๐Ÿคข ๐Ÿ”• ๐Ÿง ๐Ÿ‘ฝ ๐Ÿช” ๐ŸŒน ๐Ÿช™ โš•๏ธ๐Ÿ›Ž๏ธ ๐Ÿ’ฉ ๐Ÿก ๐Ÿ™ ๐Ÿ˜ป ๐Ÿงณ ๐ŸŽฅ ๐Ÿ’ป ๐Ÿฅถ ๐Ÿ”˜ ๐Ÿ–ฅ๏ธ ๐Ÿ”ฎ ๐Ÿณ ๐Ÿ•ณ๏ธ ๐Ÿ’ฏ ๐Ÿ’ซ ๐Ÿช ๐Ÿงจ ๐Ÿ—บ๏ธ ๐Ÿ‡จ๐Ÿ‡บ ๐Ÿฆฃ ๐Ÿฆˆ ๐Ÿฒ ๐Ÿงฑ ๐Ÿณ ๐Ÿ‡จ๐Ÿ‡ผ โ›ฉ๏ธ ๐Ÿคฏ ๐ŸŒก๏ธ ๐Ÿฅฉ ๐Ÿ‘บ ๐Ÿ“Ž ๐Ÿ’ณ ๐Ÿฆง ๐ŸŽณ ๐Ÿงถ ๐Ÿ›๏ธ ๐Ÿง  ๐Ÿฅ€ ๐Ÿ›‘ โœ”๏ธ ๐Ÿฌ ๐Ÿ‡ฎ๐Ÿ‡ฒ ๐Ÿ”ฅ from the Open Emoji API in every Go project...

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages