diff --git a/Twilio + Profanity/(Twilio + Profanity) Arabic version.py b/Twilio + Profanity/(Twilio + Profanity) Arabic version.py new file mode 100644 index 0000000..1b3cf34 --- /dev/null +++ b/Twilio + Profanity/(Twilio + Profanity) Arabic version.py @@ -0,0 +1,84 @@ +#أضيفت من قبل @Modydj +#Python 2.7 +#2 in 1 (Twilio + Profanity Editor) + + + + +#آلية العمل: + + +#1- سأقوم بإنشاء دالة def تحت اسم see_me_that_in_phone + +#2- سأجعله يعود للدالتين functions (check_profainty, read_text) + +#3- سأستقبل على جوالي فقط النتيجة ان كانت الرسالة تحوي على كلمات غير مرغوب بها أم لا + + +#حسناً ، فلنبدأ ;) + + +#استيراد المكتبات المناسبة في البداية + + + + +import urllib +from twilio.rest import Client + +# كتابة دالتين def لتحقق من عملنا، +# الأولى تدعى بـ read_text, والتي سوف تقرأ الملف المراد قراءته وفحصه. + +def read_text(): + quotes = open(r'C:\Users\2\Desktop\movie_quotes.txt','r')# قم بتغير هذا الكود بحسب مسار الملف المراد فحصه + contents_of_file = quotes.read() + #print (contents_of_file) + quotes.close() + check_profainty(contents_of_file) + +# الثانية check profanity , والتي سوف تأخذ زمام الأمور لتنفيذ الأمر +# الناتج عن قراءة الدالة الأولى read_text def. + + +def check_profainty(text_to_check): + account_sid = "ACdXXXXXXXXXXXXXXXX" #ادخل هذا الرقم من twilio + auth_token = "3bXXXXXXXXXXXXXXXXX" #ادخل هذا الرقم من twilio + client = Client(account_sid, auth_token) + connection = urllib.urlopen("http://www.wdylike.appspot.com/?q=" + text_to_check) + output= connection.read() + #print (output) + connection.close() + + if "true" in output: + message = client.messages.create( + body="profainty Alert!", + to="+213xxxxxxxx", # ضع رقم هاتفك + from_="+143xxxxxxx") # ضع رقمك في موقع twilio + print(message.sid) + + elif "false" in output: + message = client.messages.create( + body="This document has no curse words!", + to="+213xxxxxxxx", # ضع رقم هاتفك + from_="+143xxxxxxx") # ضع رقمك في موقع twilio + print(message.sid) + + else: + message = client.messages.create( + body="Could not scan the document properly.", + to="+213xxxxxxxx", # ضع رقم هاتفك + from_="+143xxxxxxx") # ضع رقمك في موقع twilio + print(message.sid) + +# الخطوة الأخيرة, ولكن في الواقع , هذه الخطوة الأولى, عندما تقوم بتشغيل البرنامج, +# هذه الدالة سوف تبدأ بالعمل على استدعاء دالة read_text . + + +def see_me_that_in_phone(): + x = read_text() + + +# دعونا نبدأ ;) + + +see_me_that_in_phone() diff --git a/Twilio + Profanity/(Twilio + Profanity) English version.py b/Twilio + Profanity/(Twilio + Profanity) English version.py new file mode 100644 index 0000000..15b38d0 --- /dev/null +++ b/Twilio + Profanity/(Twilio + Profanity) English version.py @@ -0,0 +1,81 @@ +#added by @Modydj +#Python 2.7 +#2 in 1 (Twilio + Profanity Editor) + + + +#Mechanism of Action: + +#1. I will create def call: see_me_that_in_phone + +#2 - I will make it back to the functions (check_profainty, read_text) + +#3 - Finally, I will receive on my mobile only the result if the message contains the words undesirable or not + + +#Well, Let's start: + + +#import the appropriate libraries in the first + + + +import urllib +from twilio.rest import Client + +# Write two def to check from our work, +# The first one is read_text, which will read your target file. + + +def read_text(): + quotes = open(r'C:\Users\Desktop\movie_quotes.txt','r')# Let's change this address according to your destination + contents_of_file = quotes.read() + #print (contents_of_file) + quotes.close() + check_profanity(contents_of_file) + + +# The second one is check profanity , which will take the order after knowing +# the result by using read_text def. + + +def check_profanity(text_to_check): + account_sid = "ACdXXXXXXXXXXXXXXXX" #Enter your twilio account_sid + auth_token = "3bXXXXXXXXXXXXXXXXX" # Enter your twilio account_token + client = Client(account_sid, auth_token) + connection = urllib.urlopen("http://www.wdylike.appspot.com/?q=" + text_to_check) + output= connection.read() + #print (output) + connection.close() + + if "true" in output: + message = client.messages.create( + body="profainty Alert!", + to="+213xxxxxxxx", # put your number phone + from_="+143xxxxxxx")# put your number phone on Twilio + print(message.sid) + + elif "false" in output: + message = client.messages.create( + body="This document has no curse words!", + to="+213xxxxxxxx",# put your number phone + from_="+143xxxxxxx")# put your number phone on Twilio + print(message.sid) + + else: + message = client.messages.create( + body="Could not scan the document properly.", + to="+213xxxxxxxx",# put your number phone + from_="+143xxxxxxx")# put your number phone on Twilio + print(message.sid) + +# The last step, but in fact, this is the first step, when you run this program, +# This def will start in the begging to summon read_text def. + +def see_me_that_in_phone(): + x = read_text() + + +#And here we go ;) + +see_me_that_in_phone() \ No newline at end of file diff --git a/Twilio + Profanity/(Twilio + Profanity) French version.py b/Twilio + Profanity/(Twilio + Profanity) French version.py new file mode 100644 index 0000000..45e4417 --- /dev/null +++ b/Twilio + Profanity/(Twilio + Profanity) French version.py @@ -0,0 +1,79 @@ +#ajouté par @Modydj +#Python 2.7 +# 2 en 1 ( Twilio + Profanity Éditeur) + + + +# Mécanisme d'action: + +#1. Je vais créer def appel: see_me_that_in_phone + +#2 - Je vais revenir aux fonctions: (check_profainty, read_text) + +# 3 - Enfin, je recevrai sur mon portable le résultat si le message contient les mots indésirables ou non + + +#Bien, On y va ;) + + +#importer les bibliothèques appropriées dans le premier + +import urllib +from twilio.rest import Client + +# Ecrire deux def pour vérifier de notre travail, +# Le premier est read_text, qui lira votre fichier cible. + + +def read_text(): + quotes = open(r'C:\Users\Desktop\movie_quotes.txt','r')# Changeons cette adresse en fonction de votre destination + contents_of_file = quotes.read() + #print (contents_of_file) + quotes.close() + check_profanity(contents_of_file) + + +# Le second est de vérifier check_profanity, qui prendra l'ordre après avoir connu +# le résultat en utilisant read_text def. + + +def check_profanity(text_to_check): + account_sid = "ACdXXXXXXXXXXXXXXXX" # Entrez votre twilio account_sid + auth_token = "3bXXXXXXXXXXXXXXXXX" # Entrez votre twilio account_token + client = Client(account_sid, auth_token) + connection = urllib.urlopen("http://www.wdylike.appspot.com/?q=" + text_to_check) + output= connection.read() + #print (output) + connection.close() + + if "true" in output: + message = client.messages.create( + body="profainty Alert!", + to="+213xxxxxxxx", # mettez votre numéro de téléphone + from_="+143xxxxxxx")# mettez votre numéro de téléphone sur Twilio + print(message.sid) + + elif "false" in output: + message = client.messages.create( + body="This document has no curse words!", + to="+213xxxxxxxx",# mettez votre numéro de téléphone + from_="+143xxxxxxx")# mettez votre numéro de téléphone sur Twilio + print(message.sid) + + else: + message = client.messages.create( + body="Could not scan the document properly.", + to="+213xxxxxxxx",# mettez votre numéro de téléphone + from_="+143xxxxxxx")# mettez votre numéro de téléphone sur Twilio + print(message.sid) + +# La dernière étape, mais en fait, c'est la première étape, lorsque vous exécutez ce programme, +# Cette def commencera dans le begging pour invoquer read_text def. + +def see_me_that_in_phone(): + x = read_text() + + +#Et c'est parti ;) + +see_me_that_in_phone() \ No newline at end of file