Skip to content

Instantly share code, notes, and snippets.

@penguin2716
Created March 21, 2013 03:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save penguin2716/5210453 to your computer and use it in GitHub Desktop.
Save penguin2716/5210453 to your computer and use it in GitHub Desktop.
入力されたテキストで投稿ボックスを埋めるmikutterプラグイン
# -*- 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