Created
May 13, 2014 13:46
-
-
Save firstspring1845/351826167ca918c73917 to your computer and use it in GitHub Desktop.
掘り返されたツイートを既にRTしててRTできない、そんなあなたに、RTを取り消してやり直すmikutterプラグインです
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 :dig_up do | |
command(:dig_up, | |
name: '掘り返し', | |
condition: Plugin::Command[:HasOneMessage], | |
visible: true, | |
role: :timeline) do |opt| | |
message = opt.messages.first | |
(Service.primary.twitter/'statuses/show').json(:id => message.id, :include_my_retweet => true).next do |m| | |
if m[:current_user_retweet] != nil then | |
(Service.primary.twitter/'statuses/destroy'/m[:current_user_retweet][:id]).message.next do |m| | |
message.retweet | |
end | |
else | |
message.retweet | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment