Created
August 26, 2015 16:32
-
-
Save ikr7/ae60ba50ed14fb27604f to your computer and use it in GitHub Desktop.
便利システム(便利〜!)
This file contains 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
require! { | |
\twitter : Twitter | |
} | |
class TwitterProxy | |
(keys, targetScreenName) -> | |
@account = new Twitter keys | |
@rules = [] | |
(stream) <~ @account.stream \user, _ | |
stream.on \data, (data) ~> | |
if data.text and data.user.screen_name is targetScreenName | |
text = @rules.reduce ((p, c) -> c(p)), data.text | |
@account.post \statuses/update, status: text, -> | |
module.exports = TwitterProxy |
This file contains 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
require! { | |
\twitter : Twitter | |
\./twitter-proxy : TwitterProxy | |
} | |
IKR7GYAZO_KEYS = | |
consumer_key : \iamuniverse | |
consumer_secret : \mypenisisverystrong | |
access_token_key : \sexsexsex | |
access_token_secret: \aaaaaaaa | |
tp = new TwitterProxy(IKR7GYAZO_KEYS, \lk_uta); | |
tp.rules.push (text) -> text.replace '痴漢', '$chikan$' | |
tp.rules.push (text) -> text.replace '置換', '痴漢' | |
tp.rules.push (text) -> text.replace '$chikan$', '置換' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment