diff --git a/README.md b/README.md index 26eabb4d7..a072b77d0 100644 --- a/README.md +++ b/README.md @@ -494,5 +494,5 @@ A custom background image can be supplied for the search screen by adding **acco When a moderator report is created the message at the top of the screen can be customized to provide any additional information, advice or alerts. Edit **accounts/report.txt** and add your text. -Extra emoji can be added to the *emoji* directory and you should then update the **emoji/emoji.txt** file. +Extra emoji can be added to the *emoji* directory and you should then update the **emoji/emoji.json** file, which maps the name to the filename (without the .png extension). diff --git a/content.py b/content.py index 5cfff4455..b8e0a67d8 100644 --- a/content.py +++ b/content.py @@ -165,9 +165,11 @@ def addHtmlTags(baseDir: str,httpPrefix: str, \ continue if len(wordStr)>2 and wordStr.startswith(':') and wordStr.endswith(':') and not emojiDict: print('Loading emoji lookup') - if not os.path.isfile(baseDir+'/emoji/emoji.txt'): - copyfile(baseDir+'/emoji/default_emoji.txt',baseDir+'/emoji/emoji.txt') - loadEmojiDict(baseDir+'/emoji/emoji.txt',emojiDict) + if not os.path.isfile(baseDir+'/emoji/emoji.json'): + copyfile(baseDir+'/emoji/default_emoji.json',baseDir+'/emoji/emoji.json') + with open(baseDir+'/emoji/emoji.json', 'r') as fp: + emojiDict=commentjson.load(fp) + addEmoji(baseDir,wordStr,httpPrefix,originalDomain,replaceEmoji,hashtags,emojiDict) # replace words with their html versions diff --git a/emoji/default_emoji.json b/emoji/default_emoji.json new file mode 100644 index 000000000..826dd22fd --- /dev/null +++ b/emoji/default_emoji.json @@ -0,0 +1,494 @@ +{ + "1stplacemedal": "1F947", + "abbutton": "1F18E", + "abutton": "1F170", + "airplane": "2708", + "airplanedeparture": "1F6EB", + "alarmclock": "23F0", + "anarchy": "7B2F3", + "anarchy2": "7B2F4", + "anchor": "2693", + "angelfish": "1F420", + "angry": "1F620", + "angry2": "1F621", + "angryface": "1F620", + "anxiousfacewithsweat": "1F630", + "apple": "1F34E", + "archery": "1F3F9", + "aries": "2648", + "asterisk": "002A", + "astronomicalsymbolforuranus": "26E2", + "atomsymbol": "269B", + "autorickshaw": "1F6FA", + "babyangel": "1F47C", + "backhandindexpointingup": "1F446", + "badminton": "1F3F8", + "balletshoes": "1FA70", + "ballotboxwithballot": "1F5F3", + "banana": "1F34C", + "baseball": "26BE", + "basketball": "1F3C0", + "bat": "1F987", + "beamingfacewithsmilingeyes": "1F601", + "beveragebox": "1F9C3", + "bicycle": "1F6B2", + "bird": "1F426", + "blackcrossonshield": "26E8", + "blackflag": "1F3F4", + "blackheart": "1F5A4", + "blacklargesquare": "2B1B", + "blackleftpointingindex": "261A", + "blacknib": "2712", + "blacksafetyscissors": "2700", + "blacksmallsquare": "25AA", + "blowkiss": "1F618", + "blueheart": "1F499", + "boar": "1F417", + "bottlewithpoppingcork": "1F37E", + "boy": "1F466", + "bread": "1F35E", + "breastfeeding": "1F931", + "brokenheart": "1F494", + "bull": "1F402", + "burger": "1F354", + "cactus": "1F335", + "cake": "1F370", + "callmehand": "1F919", + "camerawithflash": "1F4F8", + "candle": "1F56F", + "cardindexdividers": "1F5C2", + "carouselhorse": "1F3A0", + "cat": "1F408", + "catface": "1F431", + "ceres": "26B3", + "chains": "26D3", + "chat": "E24A", + "checkmark": "2714", + "checkmarkbutton": "2705", + "cheese": "1F9C0", + "cheesewedge": "1F9C0", + "cherry": "1F352", + "chesspawn": "265F", + "chestnut": "1F330", + "chick": "1F425", + "chicken": "1F413", + "chickface": "1F424", + "chickhatch": "1F423", + "chimpface": "1F435", + "chipmunk": "1F43F", + "church": "26EA", + "circledm": "24C2", + "circledtriangle": "1F7D5", + "clamp": "1F5DC", + "clbutton": "1F191", + "cloudwithlightningandrain": "26C8", + "clubsuit": "2663", + "cocktail": "1F378", + "coffee": "2615", + "coffin": "26B0", + "cog": "2699", + "cold": "1F976", + "combiningenclosingkeycap": "20E3", + "computermouse": "1F5B1", + "confounded": "1F616", + "confoundedface": "1F616", + "confused": "1F615", + "confusedface": "1F615", + "copyleftsymbol": "1F12F", + "copyright": "00A9", + "couchandlamp": "1F6CB", + "couplewithheart": "1F491", + "cow": "1F404", + "cowboyhatface": "1F920", + "crab": "1F980", + "cricket": "1F3CF", + "cricketgame": "1F3CF", + "croissant": "1F950", + "crossmark": "274C", + "crossmarkbutton": "274E", + "cry": "1F613", + "cupcake": "1F9C1", + "cupid": "1F498", + "curlingstone": "1F94C", + "curlyloop": "27B0", + "cyclone": "1F300", + "dagger": "1F5E1", + "desktopcomputer": "1F5A5", + "diamond": "2666", + "dieface1": "2680", + "digitzero": "0030", + "dinosaur": "1F995", + "dismay": "1F623", + "divingmask": "1F93F", + "dizzyface": "1F635", + "dog": "1F415", + "dogface": "1F436", + "dominotilehorizontalback": "1F030", + "donut": "1F369", + "doublecurlyloop": "27BF", + "doubledfemalesign": "26A2", + "doubleexclamationmark": "203C", + "dragon": "1F409", + "dropofblood": "1FA78", + "duck": "1F986", + "dumpling": "1F95F", + "eagle": "1F985", + "ear": "1F442", + "earwithhearingaid": "1F9BB", + "eat": "1F37D", + "eight": "0038", + "eightspokedasterisk": "2733", + "ejectbutton": "23CF", + "elephant": "1F418", + "envelope": "2709", + "exclamationmark": "2757", + "exclamationquestionmark": "2049", + "expressionlessface": "1F611", + "eye": "1F441", + "eyes": "1F440", + "faceblowingakiss": "1F618", + "facebook": "E042", + "facewithmonocle": "1F9E6", + "facewithopenmouth": "1F62E", + "facewithraisedeyebrow": "1F928", + "facewithtongue": "1F61B", + "fastforwardbutton": "23E9", + "fearfulface": "1F628", + "female": "2640", + "filmframes": "1F39E", + "filmprojector": "1F4FD", + "finish": "1F3C1", + "five": "0035", + "flexedbiceps": "1F4AA", + "floppydisk": "1F4BE", + "football": "26BD", + "football2": "1F3C9", + "forkandknifewithplate": "1F37D", + "fountain": "26F2", + "four": "0034", + "framedpicture": "1F5BC", + "frogface": "1F438", + "frown": "1F626", + "frowningfacewithopenmouth": "1F626", + "fuelpump": "26FD", + "gear": "2699", + "giraffe": "1F992", + "glum": "1F612", + "gnu": "1F403", + "goat": "1F410", + "grapes": "1F347", + "grasshopper": "1F997", + "greenapple": "1F34F", + "greentick": "2705", + "greytick": "2611", + "grimacingface": "1F62C", + "grinningface": "1F600", + "grumpycat": "1F63E", + "guidedog": "1F9AE", + "halloween": "1F383", + "hammerandpick": "2692", + "hammerandwrench": "1F6E0", + "hamsterface": "1F439", + "handshake": "1F91D", + "handwithfingerssplayed": "1F590", + "happy": "1F917", + "happycat": "1F638", + "happyeyebrow": "1F624", + "heart": "2665", + "heartanarchy": "7B2F2", + "heartexclamation": "2763", + "hearttipleft": "1F394", + "heavycircle": "26E3", + "hedgehog": "1F994", + "helmsymbol": "2388", + "hen": "1F414", + "highvoltage": "26A1", + "hindutemple": "1F6D5", + "hole": "1F573", + "hollowredcircle": "2B55", + "horsehead": "1F434", + "horseracing": "1F3C7", + "horserider": "1F3C7-1F3FC", + "hotdog": "1F32D", + "hotpepper": "1F336", + "hotsprings": "2668", + "hourglassnotdone": "23F3", + "house": "1F3E0", + "indexpointingup": "261D", + "infinity": "267E", + "information": "2139", + "joker": "1F0CF", + "kaaba": "1F54B", + "kangaroo": "1F998", + "keyboard": "2328", + "kickscooter": "1F6F4", + "kiss": "1F48F", + "kissing": "1F617", + "kissingface": "1F617", + "kissingfacewithclosedeyes": "1F61A", + "kissingfacewithsmilingeyes": "1F619", + "koala": "1F428", + "labcoat": "1F97C", + "label": "1F3F7", + "lacrosse": "1F94D", + "lama": "1F999", + "latincross": "271D", + "laugh": "1F923", + "laughingcat": "1F639", + "leafygreen": "1F96C", + "leftarrow": "2B05", + "lefthandtelephonereceiver": "1F57B", + "leftrightarrow": "2194", + "leftspeechbubble": "1F5E8", + "leg": "1F9B5", + "lemon": "1F34B", + "leopard": "1F406", + "lightning": "2607", + "lightskintone": "1F3FB", + "linkedpaperclips": "1F587", + "lips": "1F444", + "lips2": "1F48B", + "lobster": "1F982", + "loudlycryingface": "1F62D", + "love": "1F970", + "loveletter": "1F48C", + "loveyougesture": "1F91F", + "mahjongreddragon": "1F004", + "mahjongtileeastwind": "1F000", + "male": "2642", + "mandancing": "1F57A", + "maninsuitlevitating": "1F574", + "mellon": "1F349", + "middlefinger": "1F595", + "militarymedal": "1F396", + "monkey": "1F412", + "monkeyface": "1F432", + "monocle": "1F9D0", + "mountain": "26F0", + "mountfuji": "1F5FB", + "mouse": "1F401", + "multiplicationsign": "2716", + "mushroom": "1F344", + "music": "1F3BC", + "nailpolish": "1F485", + "network": "E249", + "neuter": "26B2", + "neutralchessking": "1FA00", + "noentry": "26D4", + "none": "0039", + "numbersign": "0023", + "obutton(bloodtype)": "1F17E", + "octopus": "1F419", + "om": "1F549", + "one": "0031", + "oneo\u2019clock": "1F550", + "onion": "1F9C5", + "ophiuchus": "26CE", + "orange": "1F34A", + "orangecircle": "1F7E0", + "orca": "1F433", + "orthodoxcross": "2626", + "outlinedwhitestar": "269D", + "owl": "1F989", + "partalternationmark": "303D", + "partyingface": "1F973", + "passengership": "1F6F3", + "pausebutton": "23F8", + "pbutton": "1F17F", + "peacesymbol": "262E", + "pen": "1F58A", + "pencil": "270F", + "penguin": "1F427", + "pentagram": "26E4", + "peoplewrestling": "1F93C", + "person": "1F9D1", + "personbiking": "1F6B4", + "personbouncingball": "26F9", + "personfacepalming": "1F926", + "persongesturingno": "1F645", + "personinbed": "1F6CC", + "personliftingweights": "1F3CB", + "personraisinghand": "1F64B", + "personrowingboat": "1F6A3", + "personstanding": "1F9CD", + "personswimming": "1F3CA", + "persontakingbath": "1F6C0", + "persontippinghand": "1F481", + "pick": "26CF", + "pig": "1F416", + "pigface": "1F437", + "pinchinghand": "1F90F", + "pinetree": "1F332", + "pinkhearts": "1F495", + "pirateflag": "1F3F4-200D-2620-FE0F", + "pizza": "1F355", + "placeofworship": "1F6D0", + "playbutton": "25B6", + "playingcardaceofclubs": "1F0D1", + "playingcardaceofdiamonds": "1F0C1", + "playingcardaceofhearts": "1F0B1", + "playingcardback": "1F0A0", + "playingcardfool": "1F0E0", + "playingcardredjoker": "1F0BF", + "pleadingface": "1F97A", + "plussign": "2795", + "poodle": "1F429", + "poop": "1F4A9", + "prayerbeads": "1F4FF", + "pregnantwoman": "1F930", + "printer": "1F5A8", + "pufferfish": "1F421", + "questionmark": "2753", + "rabbit": "1F407", + "rabbitface": "1F430", + "radioactive": "2622", + "rainbow": "1F308", + "raisedfist": "270A", + "raisedmrsign": "1F16C", + "rat": "1F400", + "recycle": "267B", + "recycling": "267B", + "redenvelope": "1F9E7", + "redhair": "1F9B0", + "redpepper": "1F336", + "regionalindicatorsymbollettera": "1F1E6", + "registered": "00AE", + "rescueworker\u2019shelmet": "26D1", + "reversebutton": "25C0", + "reversedrotatedfloralheartbullet": "2619", + "ribbon": "1F380", + "rightangerbubble": "1F5EF", + "rightarrow": "27A1", + "rightarrowcurvingleft": "21A9", + "rightarrowcurvingup": "2934", + "rightspeaker": "1F568", + "ringedplanet": "1FA90", + "robot": "1F916", + "rocket": "1F680", + "rose": "1F339", + "roundedsymbolforfu": "1F260", + "rugby": "1F3C8", + "sad": "1F614", + "sadcat": "1F63F", + "sadface": "1F622", + "safetyvest": "1F9BA", + "sailboat": "26F5", + "santaclaus": "1F385", + "sari": "1F97B", + "satellite": "1F6F0", + "scales": "2696", + "scissors": "2702", + "secret": "1F92B", + "selfie": "1F933", + "seven": "0037", + "shamrock": "2618", + "shark": "1F988", + "sheep": "1F411", + "shintoshrine": "26E9", + "shocked": "1F631", + "shrimp": "1F990", + "shuffletracksbutton": "1F500", + "sick": "1F915", + "signofthehorns": "1F918", + "silly": "1F92A", + "six": "0036", + "skate": "1F3BF", + "skateboard": "1F6F9", + "skier": "26F7", + "skull": "2620", + "skullcrossbones": "2620", + "sled": "1F6F7", + "sleepingface": "1F634", + "slightlyfrowningface": "1F641", + "sloth": "1F9A5", + "smallairplane": "1F6E9", + "smile": "263A", + "smilehearts": "1F970", + "snail": "1F40C", + "snowboarder": "1F3C2", + "snowcappedmountain": "1F3D4", + "snowflake": "2744", + "snowmanwithoutsnow": "26C4", + "soccerball": "26BD", + "sparkle": "2747", + "sparkles": "2728", + "speakinghead": "1F5E3", + "sportsmedal": "1F3C5", + "squid": "1F991", + "star": "2B50", + "starandcrescent": "262A", + "starofdavid": "2721", + "stopsign": "1F6D1", + "strawberry": "1F353", + "studiomicrophone": "1F399", + "stupa": "1F6D3", + "sun": "2600", + "sunbehindsmallcloud": "1F324", + "superhero": "1F9B8", + "swim": "1F3CA", + "tabletennis": "1F3D3", + "tagspace": "E0020", + "tea": "1F372", + "telephone": "260E", + "tennisball": "1F3BE", + "tent": "26FA", + "thermometer": "1F321", + "thinking": "1F914", + "thinkingstallman": "7B2F1", + "three": "0033", + "threelinesconvergingright": "269E", + "tick": "2714", + "tiger": "1F405", + "tomato": "1F345", + "trademark": "2122", + "trash": "E262", + "trianglewithroundedcorners": "1F6C6", + "trophy": "1F3C6", + "trumpet": "1F3BA", + "tulip": "1F337", + "turkey": "1F983", + "turtle": "1F422", + "twitter": "E040", + "two": "0032", + "umbrellawithraindrops": "2614", + "unamusedface": "1F612", + "universalrecyclingsymbol": "2672", + "upperbladescissors": "2701", + "upsidedownface": "1F643", + "variationselector16": "FE0F", + "victoryhand": "270C", + "videocamera": "1F4F9", + "violin": "1F3BB", + "warning": "26A0", + "wastebasket": "1F5D1", + "watch": "231A", + "waveman": "1F64B-1F3FE-200D-2642-FE0F", + "wavewoman": "1F64B-1F3FE-200D-2640-FE0F", + "wavydash": "3030", + "westsyriaccross": "2670", + "wheelchairsymbol": "267F", + "wheelofdharma": "2638", + "whitecircle": "26AA", + "whitedraughtsman": "26C0", + "whiteflag": "2690", + "whiteheart": "1F90D", + "whitelatincross": "1F546", + "whitemediumsmallsquare": "25FD", + "whitemediumsquare": "25FB", + "whitepennant": "1F3F1", + "whiteshogipiece": "2616", + "wiltedflower": "1F940", + "wine": "1F377", + "winkingfacewithtongue": "1F61C", + "worldmap": "1F5FA", + "worried": "1F627", + "worriedface": "1F61F", + "xiangqiredgeneral": "1FA60", + "yawn": "1F971", + "yawningface": "1F971", + "yoyo": "1FA80", + "zebra": "1F993", + "zero": "0030", + "zerowidthjoiner": "200D", + "zippermouthface": "1F910" +}