Created
January 8, 2015 12:01
-
-
Save suna-pan/d1583743b1ce30f4e076 to your computer and use it in GitHub Desktop.
mikutter_inmu_filter
This file contains 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 'rexml/document' | |
require 'open-uri' | |
Plugin.create(:mikutter_inmu_filter) do | |
filter_show_filter do |msgs| | |
msgs = msgs.select do |item| | |
if item.to_s =~ /(sm\d+)/ | |
video = "http://i.nicovideo.jp/v3/video.array?v=" + $1 | |
doc = REXML::Document.new(open(video)) | |
if doc.to_s.include?('真夏の夜の淫夢') | |
false | |
else | |
item | |
end | |
else | |
item | |
end | |
end | |
[msgs] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment