Skip to content

Instantly share code, notes, and snippets.

Forked from siyo/rt_rt_filter.rb
Last active August 29, 2015 14:01
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 =["text"]).cleaned
!(/^.+[¥"QR]T(?:[:\s]*@[A-Za-z0-9_]|\(via[:\s]*@[A-Za-z0-9_]).+[¥"QR]T/ =~ str)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment