Skip to content

Instantly share code, notes, and snippets.

@mEGGrim
Last active August 29, 2015 14:00
Show Gist options
  • Save mEGGrim/dd04c14f7b5c8ddcda83 to your computer and use it in GitHub Desktop.
Save mEGGrim/dd04c14f7b5c8ddcda83 to your computer and use it in GitHub Desktop.
EarthQuakeで公式RT&直後にRTしたポストのURLつき投稿を行うプラグイン
#-*- encoding: utf-8 -*-
Earthquake.init do
command %r|^:quote\s+(\d+)\s+(.*)$|, :as => :quote do |m|
target = twitter.status(m[1])
text = "#{m[2]} http://twitter.com/#{target["user"]["screen_name"]}/status/#{m[1].to_s}"
if confirm("retweet 'RT @#{target["user"]["screen_name"]}: #{target["text"]}'\nupdate '#{text}'")
async_e {
twitter.retweet(m[1])
twitter.update(text)
}
end
end
help :quote, "retweet and quote", <<-HELP
[$aa] hello world
:retweet $aa
:update hello world http://twitter.com/who/status/$aa
HELP
end
# https://gist.github.com/mEGGrim/dd04c14f7b5c8ddcda83
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment