-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemoji.go
97 lines (84 loc) · 8.55 KB
/
emoji.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
package main
import (
"clout/keys"
"clout/models"
"clout/network"
"clout/session"
"encoding/json"
"fmt"
"html"
"math/rand"
"strconv"
"strings"
)
func RandomEmo(n int) {
for i := 0; i < n; i++ {
items := ParseEmojiFromString()
item := items[rand.Intn(len(items))]
val, _ := strconv.ParseInt(item, 16, 64)
s := html.UnescapeString(string(val))
fmt.Println(s)
}
}
func HandleClown() {
items := ParseEmojiFromString()
item1 := items[rand.Intn(len(items))]
item2 := items[rand.Intn(len(items))]
item3 := items[rand.Intn(len(items))]
val1, _ := strconv.ParseInt(item1, 16, 64)
val2, _ := strconv.ParseInt(item2, 16, 64)
val3, _ := strconv.ParseInt(item3, 16, 64)
str1 := html.UnescapeString(string(val1))
str2 := html.UnescapeString(string(val2))
str3 := html.UnescapeString(string(val3))
text := fmt.Sprintf("%s%s%s = $%d", str1, str2, str3, SumIt(item1)+SumIt(item2)+SumIt(item3))
fmt.Println(text)
mnemonic := session.ReadLoggedInWords()
if mnemonic == "" {
return
}
pub58, priv := keys.ComputeKeysFromSeed(session.SeedBytes(mnemonic))
longHash := "a167e616c33047f73ce386bb877b0044b275ca59aa12af1a5a0312b10c3a756b"
bigString := network.SubmitPost(pub58, text, longHash, "")
var tx models.TxReady
json.Unmarshal([]byte(bigString), &tx)
jsonString := network.SubmitTx(tx.TransactionHex, priv)
if jsonString != "" {
fmt.Println("Success.")
}
}
func SumIt(item string) int64 {
sum := int64(0)
for i, _ := range item {
thing := item[i : i+1]
val, _ := strconv.ParseInt(thing, 16, 64)
sum += val
}
return sum
}
func ParseEmojiFromString() []string {
tokens := strings.Split(emojiTableString, ",")
return tokens
}
func ParseEmojiFromHTML() map[string]bool {
m := map[string]bool{}
tokens := strings.Split(emojiTableString, "<tr>")
for _, token := range tokens {
tokens = strings.Split(token, "<td>")
if len(tokens) <= 4 {
continue
}
thing := tokens[4]
thing = thing[6 : len(thing)-7]
tokens = strings.Split(thing, ";")
for _, token = range tokens {
if !strings.HasPrefix(token, "#x") {
continue
}
thing = token[2:]
m[thing] = true
}
}
return m
}
var emojiTableString = `1F5FC,1F68F,26C5,1F93D,1F4F5,1F502,1F364,1F30E,1F45B,1F304,1F51A,1F625,1F61D,2757,23F8,0039,1F17F,1F1EE,1F3DF,23ED,1F30A,1F191,1F33D,1F3EB,1F3CB,2623,1F617,1F614,1F37C,1F55B,1F389,1F531,1F53B,1F649,1F40E,1F496,1F410,1F940,1F3A0,1F55C,0023,1F4A0,1F1ED,1F46B,1F42E,1F1E8,1F476,1F38C,1F5FE,1F93C,1F5D2,1F917,1F473,1F6AD,267B,1F980,1F34C,1F3D1,1F5F3,1F45D,1F3CF,1F3F5,1F98D,1F1F9,1F4B7,1F58C,1F22F,2B1B,1F3AA,1F31C,2618,2708,1F511,1F478,1F44D,1F621,1F36A,1F6B0,1F4DA,2139,1F518,1F910,1F688,1F32E,1F4C3,1F6C4,20E3,1F345,1F954,25B6,1F914,2697,1F320,1F4E6,2649,1F376,1F3E9,1F6EB,1F60A,1F422,1F4AB,1F3A8,1F6F3,1F6D0,2639,1F64B,1F497,1F4F4,1F32C,00A9,1F192,1F334,1F683,1F95A,2615,1F50C,1F480,1F392,1F420,1F4AF,1F358,1F5A8,1F234,1F427,1F95E,1F697,2652,1F3A6,1F1EC,1F1FE,1F922,1F48C,1F390,1F52D,1F4A8,1F312,1F6E3,1F381,1F418,1F956,1F451,1F561,1F4FA,1F237,3297,1F47A,261D,1F472,1F565,23F3,1F399,1F4F3,1F238,1F463,1F49C,1F681,1F3AB,2049,1F64C,1F54C,1F446,1F236,1F316,1F4DE,270F,1F6D1,1F6BF,26C4,1F6A3,1F47F,1F483,1F421,1F6A5,1F319,1F3B2,1F3F7,1F5D3,1F404,1F98F,1F52B,1F4C6,1F530,1F31B,1F3A5,274E,1F573,1F455,1F40D,1F35D,231A,1F628,1F608,1F3DC,2728,1F391,26F9,2194,1F53D,1F447,1F991,1F939,1F44F,1F366,1F562,1F31F,2714,1F1F4,1F1F0,1F62C,1F423,1F987,1F46F,1F310,1F300,1F4F6,1F603,24C2,1F55E,1F4C7,1F576,1F54D,1F37D,1F4CC,1F648,1F37E,1F3E1,1F69C,21A9,1F432,1F948,1F4F7,1F194,1F411,1F508,1F30C,1F3CD,2653,1F426,1F95C,1F305,1F53C,1F51F,1F64F,1F332,1F985,1F32F,1F3E3,1F3EE,1F602,1F448,1F3BA,1F4B6,2626,1F35F,1F68E,1F197,1F642,1F6AC,1F23A,1F1F8,1F4CD,1F201,1F40C,1F3DB,1F3EC,2122,1F640,1F44E,1F354,1F369,1F6B4,1F39E,1F6B3,1F459,1F43B,1F95D,1F3E6,1F529,1F6AF,1F6B7,2199,1F49B,1F401,1F3C8,1F415,1F986,1F951,1F475,1F436,1F6EC,1F563,1F3B5,1F17E,1F600,1F630,1F425,1F433,1F3D8,0037,1F393,1F400,263A,1F303,274C,2764,2721,1F52F,1F1F3,1F424,1F31D,1F627,1F461,1F383,1F3BC,1F1EB,1F440,1F952,1F1FB,1F958,1F4DD,1F620,1F595,1F499,1F408,1F40B,1F3ED,00AE,1F251,1F935,1F44A,26AB,27A1,264A,1F1EF,1F578,1F944,1F37B,1F6AA,1F4BE,1F5A4,1F331,1F4F2,1F5C4,1F360,1F3A1,2734,2603,1F4EC,1F6E1,1F537,1F43F,1F43C,1F3AC,1F42B,1F68D,1F6F4,26C8,1F3D3,1F60C,1F984,1F33E,1F5FD,1F49E,1F437,1F4EA,269B,0035,1F362,1F942,1F38B,2935,1F596,1F34B,1F372,1F957,1F397,1F396,1F646,1F48F,1F199,1F1FA,1F6BE,1F521,2702,2650,1F41B,1F959,1F52C,2705,1F63B,1F91C,1F350,1F6A1,1F6C3,2195,1F632,1F3FD,1F6CF,2602,26F8,0033,1F1E9,1F434,2693,1F313,1F3C7,26F0,1F4BA,1F4FD,1F4DB,1F495,1F4EF,1F339,1F306,1F6A4,1F4C5,203C,1F506,1F606,1F645,1F0CF,1F3B9,1F5A5,1F641,1F3D4,262A,23EE,1F35C,1F308,1F6A0,1F5B1,1F494,1F33F,262E,3030,1F610,1F40A,1F4E7,1F509,1F1FC,1F4AE,1F6C0,1F44B,1F407,1F618,1F943,1F481,1F441,1F352,1F695,1F18E,1F47B,1F638,1F431,26FD,2712,1F601,1F450,1F343,1F68C,1F693,1F38A,1F380,23FA,1F98C,1F42C,1F3D0,1F1F6,1F336,1F551,1F682,1F38D,2665,25AA,1F91D,1F45F,2600,1F587,1F4A4,1F315,1F33C,1F689,1F387,2747,1F522,1F643,1F40F,1F4FB,1F519,264C,1F926,1F3F8,1F5E8,1F4ED,1F4C0,1F549,1F5EF,231B,1F338,1F1FD,1F61A,1F611,1F953,1F3E8,1F324,1F515,1F501,1F619,1F4AD,1F6A8,2663,25FE,1F3FF,1F3D9,1F513,1F988,1F4E8,1F58A,1F517,25C0,1F523,1F990,1F3A3,1F34A,1F36F,1F492,1F32B,1F4F9,1F4FC,1F442,1F45E,1F4D2,26F7,1F235,1F385,1F35E,1F93E,1F4BB,1F1FF,1F61E,1F47D,1F193,1F6C5,303D,1F3E2,1F579,1F5C3,1F356,1F375,1F607,1F91E,1F449,1F510,1F924,1F63E,1F330,1F3DE,23F0,1F328,1F4D1,27BF,270A,1F989,1F1EA,1F382,1F4C4,1F4D0,2753,1F465,1F342,1F4BD,1F4CF,1F4B8,1F1E7,200D,1F93A,1F34E,1F6E4,1F45A,1F337,1F3E4,26EA,1F947,1F3B4,2328,1F4C9,1F467,1F47C,26B1,1F195,1F3B3,1F516,0036,1F934,1F42F,1F414,1F5B2,26D4,1F64A,1F3A9,1F4DC,1F6F0,1F94A,1F3F0,267F,1F69F,25AB,1F329,26A0,264D,1F981,1F41C,1F505,1F35A,2622,1F54A,1F438,1F68A,1F698,1F4B4,1F239,1F4A9,1F91B,1F536,1F3D5,1F520,1F318,1F3BB,1F4A6,1F484,1F685,26F4,1F46E,1F49A,2611,1F9C0,1F949,1F417,1F439,1F4F0,1F19A,1F471,1F462,1F344,1F52A,1F5FA,1F555,1F314,1F39F,1F639,1F98A,0030,1F3CC,2197,26D3,1F42A,1F3D6,1F558,1F4E3,1F4B5,264F,1F920,1F46D,264B,1F577,2666,1F552,1F559,1F4DF,1F4F8,2B07,1F915,1F930,1F6CE,1F55A,1F4A7,1F41F,1F69A,1F4D5,2755,270D,1F3B6,23EF,1F527,269C,23E9,1F4AA,1F941,1F55D,26F3,1F5D1,1F61C,1F6CB,1F1F5,1F41D,1F6B2,1F3C5,1F5FF,1F3D7,1F556,2795,1F1F7,1F550,1F50A,2733,1F301,2668,1F32A,1F4BF,1F4CE,2754,1F60B,1F615,1F532,1F48B,1F377,23F1,26B0,1F54E,1F47E,1F98B,1F58D,2694,1F3F9,1F6E2,1F62F,2601,1F69E,1F4E5,1F62D,1F63F,1F39A,002A,1F416,1F945,1F452,1F4E1,1F609,1F470,1F58B,26AA,1F923,1F482,1F38F,1F37F,1F626,1F64D,1F647,1F3D2,1F51E,1F538,1F60D,1F925,2716,1F3F4,1F474,2198,2797,1F170,1F355,1F6BC,1F21A,1F61B,1F468,1F386,1F39B,1F612,1F3CE,1F33A,1F36E,26FA,1F326,1F3C0,1F5DC,1F634,1F487,1F6B9,1F982,1F950,26D1,1F6E9,23F2,1F3BE,1F4B2,FE0F,1F46A,1F4F1,25FD,1F374,1F694,1F6E5,1F5C2,2648,1F6A9,1F341,26E9,1F5E3,1F46C,2B50,1F623,1F629,1F4CA,1F534,1F622,1F50E,26CE,26BD,1F51C,1F35B,271D,23CF,1F62A,1F936,1F575,1F464,1F6BD,2614,1F5DE,1F489,1F636,1F624,1F570,1F3AF,1F370,1F3B0,2692,27B0,1F3FA,1F5FB,1F34F,1F32D,1F95B,2709,1F631,1F6CD,1F202,1F3EF,2796,1F357,2B06,1F456,1F43E,1F68B,2B05,1F196,1F53A,1F498,1F363,1F69B,2696,1F3FC,1F684,1F307,1F687,1F4EE,1F503,1F454,1F403,1F4D4,1F445,1F564,1F460,1F4FF,1F955,26F5,21AA,1F63C,1F44C,1F98E,1F419,1F3E5,1F6A2,2660,1F3A4,1F63D,1F402,1F4C8,1F429,1F36C,1F6C1,1F3E7,1F466,1F48D,1F373,1F50F,1F913,1F43D,1F30B,1F4D9,1F45C,1F41A,2744,1F94B,1F64E,1F405,1F696,1F699,1F938,26CF,1F435,1F30D,1F36D,1F379,1F311,1F3C9,2934,264E,1F428,1F413,1F348,1F3E0,1F3EA,1F3AD,1F325,1F302,1F469,270C,1F4A1,1F388,1F3B7,1F351,1F233,1F605,1F937,1F4E9,2699,1F6AB,1F3F3,1F3A2,1F4E0,1F378,1F6CC,1F590,2763,1F6F6,1F3B8,1F6C2,1F60E,1F491,1F367,1F48A,2B55,23EB,0031,1F918,1F406,3299,1F911,1F637,1F37A,1F4D7,1F528,1F60F,1F33B,1F3C6,1F479,1F453,1F6BA,1F55F,1F4B1,1F5DD,1F335,1F371,1F4B9,1F198,1F933,1F3A7,1F553,1F560,1F4BC,1F250,1F4AC,1F48E,1F4EB,1F171,1F457,1F412,26A1,1F4CB,1F444,1F49F,1F557,1F533,1F635,1F443,1F333,1F56F,1F507,1F4A3,1F349,1F1F2,1F30F,1F4D6,1F4E4,1F3C1,1F613,1F3FB,1F34D,1F6F5,262F,1F604,1F616,1F50D,1F4B3,1F6B6,1F3DA,2B1C,1F38E,1F4B0,1F539,1F535,1F365,25FB,1F346,1F5BC,1F691,1F1E6,1F912,1F3FE,1F3C2,1F340,26F2,25FC,1F1F1,1F4A5,23EA,23EC,1F644,1F567,1F353,1F4C2,1F51D,1F62E,1F927,1F43A,1F368,1F512,1F49D,1F458,1F004,1F504,1F232,1F409,1F3BD,1F4D3,1F6E0,1F6B8,1F921,1F6A7,1F57A,1F31E,2604,1F6B5,1F50B,1F62B,1F633,1F36B,1F54B,1F52E,1F6AE,1F500,1F485,1F42D,1F384,1F4E2,1F526,1F477,1F692,0034,1F3C4,1F4C1,1F347,1F361,260E,1F5E1,1F91A,1F493,1F359,1F3B1,2638,0032,2620,1F916,1F490,2651,1F525,1F3AE,1F6B1,1F4A2,1F430,1F514,2196,270B,1F6A6,1F574,1F983,1F686,1F4D8,1F6BB,23F9,1F63A,1F309,1F3DD,1F51B,1F690,1F554,1F566,1F31A,26F1,1F6D2,1F488,1F69D,0038,1F317,1F327,1F61F,1F3C3,1F321,26BE,1F486,1F919,1F3BF,1F3CA,1F524,1F41E,1F680`