Skip to content

Instantly share code, notes, and snippets.

@penguin2716
Created November 9, 2011 18: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/1352287 to your computer and use it in GitHub Desktop.
Save penguin2716/1352287 to your computer and use it in GitHub Desktop.
えあふぁぼするmikutterプラグイン
# -*- coding: utf-8 -*-
Plugin.create(:airfav) do
def self.airfav(m)
Thread.new{
sleep(0.5 + rand(500) / 1000.0)
m.message.add_favorited_by(Post.primary_service.user_obj)
m.message.remove_favorited_by(Post.primary_service.user_obj)
}
end
add_event_filter(:command){ |menu|
menu[:airfav] = {
:slug => :airfav,
:name => 'えあふぁぼ',
:condition => lambda{ |m| m.message.favoritable? },
:exec => lambda{ |m| Gtk::TimeLine.get_active_mumbles.map(&:message).each{ |m| airfav(m)} },
:visible => true,
:role => :message }
[menu]
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment