-
Notifications
You must be signed in to change notification settings - Fork 0
/
GoogleCode.m
115 lines (102 loc) · 2.89 KB
/
GoogleCode.m
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
function doPost(e) {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var rowData = [];
// Push the data to the rowData array
rowData.push(new Date()); // Timestamp
rowData.push(e.parameter.name); // Name
// Replace certain words in the message
var message = e.parameter.message;
message = replaceWords(message);
rowData.push(message); // Message
// Append the rowData to the sheet
sheet.appendRow(rowData);
// Return an empty response after processing the form submission
return ContentService.createTextOutput("");
}
function replaceWords(message) {
// Define the word replacements
var replacements = {
// English curse words and variations
"fuck": "f##k",
"fuc k": "f##k",
"fu*k": "f##k",
"shit": "$#!t",
"sh!t": "$#!t",
"sh*t": "$#!t",
"bitch": "b###h",
"b!tch": "b###h",
"bi*ch": "b###h",
"asshole": "a##hole",
"a$$hole": "a##hole",
"a$$h0le": "a##hole",
// Arabic curse words and variations
"كسمك": "ك$#مك",
"كس اختك": "ك$ اختك",
"خرا": "خ#ا",
"زب": "ز#ب",
"زبالة": "ز$#الة",
"زبر": "ز#ر",
// Additional variations
"zab": "z#b",
"zib": "z#b",
"zeb": "z#b",
"zibi": "z#b",
"zuba": "z#b",
"zibo": "z#b",
"zubo": "z#b",
"zubu": "z#b",
"miboun": "m$#!un",
"mibouna": "m$#!una",
// English letters with Arabic pronunciation and variations
"kasemak": "k##mak",
"kas akhtak": "k## akhtak",
"khara": "kh#ra",
// Additional Tunisian bad words
"3asab": "3$ab",
"neek": "n##k",
"3as": "3$",
"3os": "3$",
"5ra": "5#ra",
"5arya": "5#ra",
"ta7an": "ta#an",
"9a7ba": "9a#ba",
"9a7 ba": "9a#ba",
"zabb": "z##b",
// Code replacement addition
"<style>": "style",
"gay": "g#y",
"gaay": "g#y",
};
// Iterate through the replacements and replace words in the message
for (var word in replacements) {
if (replacements.hasOwnProperty(word)) {
var regex = new RegExp("\\b" + word + "\\b", "gi"); // Case insensitive whole word match
message = message.replace(regex, replacements[word]);
}
}
return message;
}
function doGet() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var data = sheet.getDataRange().getValues();
var jsonData = [];
for (var i = 1; i < data.length; i++) {
var row = data[i];
var rowData = {
timestamp: row[0], // Timestamp
name: row[1], // Name
message: row[2] // Message
};
jsonData.push(rowData);
}
return ContentService.createTextOutput(JSON.stringify(jsonData)).setMimeType(ContentService.MimeType.JSON);
}
================ ken mazel famma klem mahowech mitzed iktbo louta ==============
function replaceWords(message) {
var replacements = {
// words that aren't added yet
"sex": "s*x",
"nik": "n##k",
// add more
}
}