Created
January 24, 2017 13:47
-
-
Save arumic/b4e308ba37331fe6f272e34d30cf5101 to your computer and use it in GitHub Desktop.
bansheeで再生中の曲情報を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 -*- | |
# bansheeで再生中の曲情報をmikutterでツイートするプラグイン | |
# mikutter3.5.1・banshee2.6.2で動作確認 | |
# ツイート入力用のテキストボックスを右クリック→メニューの「Banshee Now Playing」でツイート | |
Plugin.create(:banshee_nowplaying) do | |
def banshee_now_playing | |
title = `banshee --query-title`[7..-2] | |
artist = `banshee --query-artist`[8..-2] | |
album = `banshee --query-album`[7..-2] | |
trucknumber = `banshee --query-track-number`[14..-2] | |
msg = "#nowplaying " + title + " - " + artist + " [" + album + " Tr." + trucknumber + "]" | |
Service.primary.post :message => msg | |
end | |
command(:banshee_playing_post, | |
name: 'Banshee Now Playing', | |
condition: lambda{ |opt| true }, | |
visible: true, | |
role: :postbox) do |opt| | |
banshee_now_playing | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment