-
Notifications
You must be signed in to change notification settings - Fork 0
/
leet.py
52 lines (45 loc) · 2.36 KB
/
leet.py
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
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import weechat as w
import random, re
w.register("leet", "leet", "1.0", "GPL3", "conver text to leet text", "", "")
leet_dic = {'A':['4','^','(L','Д'],
'B':['I3','8','13','|3','ß','P>','|:','!3','(3','/3',')3','|-]','j3'],
'C':['[','¢','<','(','©'],
'D':[')','|)','(|','|o','[)','I>','|>','T)','I7','cl','|}','|]'],
'E':['3','&','£','€','ë','[-',],
'F':['|=','ƒ','|#','ph','/=','v'],
'G':['6','&','(_+','9','C-','(?,','[,','{,','<-','(.'],
'H':['#','/-/','[-]',']-[',')-(','(-)',':-:','|~|','|-|',']~[','}{','!-!','1-1','\-/','I+I',
'}-{'],
'I':['1','!','¡','|','][',']'],
'J':['_|','_/','¿','</','_]','(/'],
'K':['|<','|{',']{','|X'],
'L':['1','£','7','1_','|','|_','[]_','[_'],
'M':['|v|','[V]','{V}','/VAA','|\/|','/\/(u)','(V)','(\/)','/|^^','/|/|','//|\|]\/['],
'N':['^/','|\|','/\/','[\]','<\>','[]//','[]','/V','1V','И','^','ท^/','|\|','/\/','[\]','<\>','en','[]//','[]','/V','1V','И','^','ท'],
'O':['0','()','[]','p','<>','Ø'],
'P':['|*','|o','|º','|^(o)','|>','|"','9','[]D','|°','|7'],
'Q':['(_,)','()_','0_','<|','&'],
'R':['I2','|`','|~','|?','/2','|^','lz','|9','2','12','®','[z','Я','.-','|2','|-'],
'S':['5','$','z','§'],
'T':['7','+','-|-',"']['",'†','"|"'],
'U':['(_)','|_|','v','L|','µ','บ'],
'V':['\/','|/','\|'],
'W':['\/\/','vv','\N',"'//","\'",'\^/','(n)','\V/','\X/','\|/','\_|_/','\_:_/','Ш','uu','2u','\//\//','พ','ω'],
'X':['><','Ж','}{','×','?',')(','][','}{'],
'Y':['j','`/','Ч','7','\|/','¥'],
'Z':['2','7_','-/_','%','>_','s','~/_','-\_','-|_']
}
def modifier_cb(data, modifier, modifier_data, string):
test = string.split(":")[-1]
test = convert_leet(test)
string = ":".join(string.split(":")[:-1]+[test])
# w.prnt_date_tags("",0,"no_log","test: %s"% ":".join(string.split(":")[:-1]+[test])) # for watching dic
return string
def convert_leet(string):
string = re.sub(r"[A-Za-z]", re_upper, string)
return string
def re_upper(mo):
return random.choice(leet_dic[mo.group(0).upper()])
w.hook_modifier("irc_in_privmsg", "modifier_cb", "")