Qrustスコアを表示するmikutterプラグイン
# -*- coding: utf-8 -*- | |
Plugin.create :qrust_score do | |
command(:qrust_score, | |
name: 'こいつのQrustのスコアを表示', | |
icon: "http://qru.st/favicon.ico", | |
condition: lambda{ |opt| true }, | |
visible: true, | |
role: :timeline) do |opt| | |
opt.messages.each do |m| | |
Thread.new { | |
html = open("http://qru.st/twitter/#{m.user.to_s}").read | |
if html =~ /data-text="(\.@[^"]+。)/ | |
Plugin.call(:update, nil, [Message.new(message: $1 + "\nhttp://qru.st/twitter/#{m.user.to_s}", system: true)]) | |
end | |
} | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment