Created
September 25, 2013 13:36
-
-
Save syusui-s/6699701 to your computer and use it in GitHub Desktop.
Eject風鈴のソースコード
This file contains hidden or 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(: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