Skip to content

Instantly share code, notes, and snippets.

@morygonzalez
Forked from siyo/rt_rt_filter.rb
Last active August 29, 2015 14:01
Embed
What would you like to do?
多段非公式RTフィルタ earthquake.gem plugin (invalid byte sequence in UTF-8 (ArgumentError) 対応版)
# -*- 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