Skip to content

Instantly share code, notes, and snippets.

@firstspring1845
Created May 13, 2014 13:46
Show Gist options
  • Save firstspring1845/351826167ca918c73917 to your computer and use it in GitHub Desktop.
Save firstspring1845/351826167ca918c73917 to your computer and use it in GitHub Desktop.
掘り返されたツイートを既にRTしててRTできない、そんなあなたに、RTを取り消してやり直すmikutterプラグインです
#-*- 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