Created
March 21, 2013 03:22
-
-
Save penguin2716/5210453 to your computer and use it in GitHub Desktop.
入力されたテキストで投稿ボックスを埋める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 -*- | |
Plugin.create :fill_postbox do | |
command(:fill_postbox, | |
name: '投稿ボックスを埋める', | |
condition: lambda{ |opt| true }, | |
visible: true, | |
role: :postbox) do |opt| | |
str = Plugin.create(:gtk).widgetof(opt.widget).widget_post.buffer.text | |
if str.size > 0 | |
result = "" | |
result += str while result.size < 140 | |
Plugin.create(:gtk).widgetof(opt.widget).widget_post.buffer.text = result[0..139] | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment