Created
November 9, 2011 17:24
-
-
Save penguin2716/1352165 to your computer and use it in GitHub Desktop.
ふぁぼれなかったら非公式ふぁぼ飛ばすmikutterプラグイン
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 -*- | |
Plugin.create(:altfav) do | |
def self.altfav(m) | |
if Post.primary_service.twitter.favorite(m.message.id).code != '200' then | |
Post.primary_service.update(:message => "@#{m.message.user.to_s} ★#{" " * rand(40)}", :replyto => m.message) | |
end | |
end | |
add_event_filter(:command){ |menu| | |
menu[:altfav] = { | |
:slug => :altfav, | |
:name => 'ふぁぼ/非公式ふぁぼ', | |
:condition => lambda{ |m| m.message.favoritable? }, | |
:exec => lambda{ |m| Gtk::TimeLine.get_active_mumbles.map(&:message).each{ |m| altfav(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