Skip to content

Instantly share code, notes, and snippets.

@penguin2716
Created November 9, 2011 17:24
Show Gist options
  • Save penguin2716/1352165 to your computer and use it in GitHub Desktop.
Save penguin2716/1352165 to your computer and use it in GitHub Desktop.
ふぁぼれなかったら非公式ふぁぼ飛ばすmikutterプラグイン
# -*- 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