Skip to content

Instantly share code, notes, and snippets.

@arumic
Created January 24, 2017 13:47
Show Gist options
  • Save arumic/b4e308ba37331fe6f272e34d30cf5101 to your computer and use it in GitHub Desktop.
Save arumic/b4e308ba37331fe6f272e34d30cf5101 to your computer and use it in GitHub Desktop.
bansheeで再生中の曲情報をmikutterでツイートするプラグイン
# -*- 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