Skip to content

Instantly share code, notes, and snippets.

@syusui-s
Created September 25, 2013 13:36
Show Gist options
  • Select an option

  • Save syusui-s/6699701 to your computer and use it in GitHub Desktop.

Select an option

Save syusui-s/6699701 to your computer and use it in GitHub Desktop.
Eject風鈴のソースコード
# -*- coding: utf-8 -*-
Plugin.create(:eject_huurin) do
UserConfig[:eject_huurin_lock] ||= false
def optEject
if not UserConfig[:eject_huurin_lock] then
UserConfig[:eject_huurin_lock] = true
system("eject /dev/sr0;sleep 1;eject -t /dev/sr0")
UserConfig[:eject_huurin_lock] = false
end
end
on_mention do |service, messages|
msg = Plugin.filtering(:show_filter, messages.select{ |m| not(m.from_me? or m[:retweet]) and m[:created] > DEFINED_TIME }).first
if not(msg.empty?)
optEject
end
end
on_favorite do |service, by, to|
if to.from_me?
optEject
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment