-
-
Save morygonzalez/6601afbd904e64a02eec to your computer and use it in GitHub Desktop.
多段非公式RTフィルタ earthquake.gem plugin (invalid byte sequence in UTF-8 (ArgumentError) 対応版)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
require 'utf8-cleaner' | |
Earthquake.init do | |
output_filter do |item| | |
next if item.nil? || item["text"].nil? | |
str = UTF8Cleaner::URIString.new(item["text"]).cleaned | |
!(/^.+[¥"QR]T(?:[:\s]*@[A-Za-z0-9_]|\(via[:\s]*@[A-Za-z0-9_]).+[¥"QR]T/ =~ str) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment