From 1b4d8f0a3cfc5cd5115e3ef8adcbea4b8ece75db Mon Sep 17 00:00:00 2001 From: anekos Date: Fri, 26 Aug 2011 18:16:57 +0900 Subject: 誤字のあるツイートを Fav / RT しないためのプラグイン --- twittperator/anti-goji.tw | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 twittperator/anti-goji.tw diff --git a/twittperator/anti-goji.tw b/twittperator/anti-goji.tw new file mode 100644 index 0000000..2f0f956 --- /dev/null +++ b/twittperator/anti-goji.tw @@ -0,0 +1,21 @@ + +/* + * 誤字のあるツイートを Fav / RT してツイートした人を切ない気分にさせないためのプラグインです。 + * 誤字のあるツイートに Fav / RT すると、エラーを出して中止してくれます。 + * (誤字のあるツイートには必ず、#誤字有り とハッシュタグをつけるように周知徹底してください。 + */ + +'favorite retweet'.split(/\s+/).forEach(function (name) { + plugins.libly.$U.around( + plugins.twittperator.Twitter, + name, + function (next, [id]) { + let goji = plugins.twittperator.Tweets.some(function (it) ((it.id == id) && /[##]誤字[アあ有][りリ]?/.test(it.text))); + if (goji) { + liberator.echoerr('The tweet has some gojis! DON NOT ' + name.toUpperCase() + '!!'); + } else { + return next; + } + } + ); +}); -- cgit v1.2.3