|
|
|
@ -315,11 +315,23 @@ if __name__ == '__main__':
|
|
|
|
|
|
|
|
|
|
while i < len(id_lst):
|
|
|
|
|
|
|
|
|
|
if detect(text_lst[i]) != 'ca' or len(text_lst) == 1:
|
|
|
|
|
if len(text_lst[i]) > 1:
|
|
|
|
|
|
|
|
|
|
text_lang = detect(text_lst[i])
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
|
|
text_lang = 'en'
|
|
|
|
|
|
|
|
|
|
if text_lang != 'ca' or len(text_lst) == 1:
|
|
|
|
|
|
|
|
|
|
is_tor_exit_node = check_ip(ip_lst[i])
|
|
|
|
|
|
|
|
|
|
tor_exit_node = 't' if is_tor_exit_node else 'f'
|
|
|
|
|
tor_exit_node = 't' if is_tor_exit_node == 't' else 'f'
|
|
|
|
|
|
|
|
|
|
text_length = 200 if len(text_lst[i]) > 200 else len(text_lst[i])
|
|
|
|
|
|
|
|
|
|
reason_text = '{0}...'.format(text_lst[i][:text_length].rsplit(' ', 1)[0])
|
|
|
|
|
|
|
|
|
|
conn = None
|
|
|
|
|
|
|
|
|
@ -329,7 +341,7 @@ if __name__ == '__main__':
|
|
|
|
|
|
|
|
|
|
cur = conn.cursor()
|
|
|
|
|
|
|
|
|
|
cur.execute(insert_sql, (created_at_lst[i], id_lst[i], email_lst[i], ip_lst[i], text_lst[i], tor_exit_node))
|
|
|
|
|
cur.execute(insert_sql, (created_at_lst[i], id_lst[i], email_lst[i], ip_lst[i], reason_text, tor_exit_node))
|
|
|
|
|
|
|
|
|
|
conn.commit()
|
|
|
|
|
|
|
|
|
|