lib/ayadn/workers.rb in ayadn-2.0.10 vs lib/ayadn/workers.rb in ayadn-2.0.11

- old
+ new

@@ -211,11 +211,24 @@ end end end end next if @skip - + unless Settings.global[:force] == true + if Settings.options[:blacklist][:active] == true + post['text'].split(" ").each do |word| + target_word = word.gsub(/[~:-;,?!\'&`^=+<>*%()\/"“”’°£$€.…]/, "") + if Databases.is_in_blacklist?('word', target_word.downcase) + Debug.skipped({word: target_word}) + @skip = true + break + end + end + end + end + next if @skip + # create custom objects from ADN response if niceranks[post['user']['id'].to_i] rank = niceranks[post['user']['id'].to_i][:rank] is_human = niceranks[post['user']['id'].to_i][:is_human] real_person = niceranks[post['user']['id'].to_i][:real_person] @@ -534,9 +547,11 @@ word_chars = word.chars sanitized, word = [], [] word_chars.each do |ch| if UnicodeUtils.general_category(ch) == :Other_Symbol sanitized << "#{ch} " + elsif UnicodeUtils.char_name(ch).nil? + next else sanitized << ch end end word = sanitized.join