Skip to content

Instantly share code, notes, and snippets.

@penguin2716
Created March 20, 2013 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save penguin2716/5203292 to your computer and use it in GitHub Desktop.
Save penguin2716/5203292 to your computer and use it in GitHub Desktop.
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