Last active
August 29, 2015 14:00
-
-
Save mEGGrim/dd04c14f7b5c8ddcda83 to your computer and use it in GitHub Desktop.
EarthQuakeで公式RT&直後にRTしたポストのURLつき投稿を行うプラグイン
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
#-*- 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