Created
April 7, 2011 13:42
-
-
Save ne-sachirou/907791 to your computer and use it in GitHub Desktop.
NGID.js #AzureaScript
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
// ==AzureaScript== | |
// @name ne_NGID | |
// @author http://c4se.sakura.ne.jp/profile.html | |
// @scriptUrl https://gist.github.com/raw/907791/ | |
// @date 2011-04-07 | |
// @license Public Domain | |
// ==/AzureaScript== | |
// == Usage | |
// Write [user.ne_NGID] section & NGID field to Azurea.ini | |
// ex. | |
// [user.ne_NGID] | |
// NGID=c4se_always, ne_sachirou | |
// | |
// cf. | |
// [Twitter / @せい: @ne_sachirou @ne_sachirou .。oO(AzureaはNGIDが無いのが最大の難点かなぁ。無いよねぇ?後リストだとNGが無効になる。さっちゃん拡張で出来る??)]( https://twitter.com/#!/sei_mel/status/55975058979565568 ,"") | |
// [Twitter / @ももんが戦隊☆さっちゃんであるぞ: @sei_mel IDだけを決め打ちでfilterするのなら、インターフェースの簡単に出来ますし、直ぐですね。特にAzureaVimと独立にして、iniに手書きするタイプなら、本当に直ぐですね。水分補充したら作ってみましょう。]( https://twitter.com/#!/ne_sachirou/status/55975600556482561 ,"") | |
// [Twitter / @せい: @ne_sachirou @ne_sachirou .。oO(ありがとー♪助かります。震災時にヒスリックなタイムラインになった時に大分リムーブしちゃって。NGIDないかなぁって思ってたんです。)]( https://twitter.com/#!/sei_mel/status/55975917280956416 ,"") | |
if (!Array.prototype.indexOf) { | |
Array.prototype.indexOf = function (v, // @param Object: | |
n) { // @param Number=0: | |
// @return Number: not found = -1 | |
var i = 0, | |
l = this.length; | |
n = n || 0; | |
while (n < 0) { | |
n += l - 1; | |
} | |
for(i = n; i < l; ++i) { | |
if (this[i] === v) { | |
return i; | |
} | |
} | |
return -1; | |
}; | |
} | |
var NGIDs = System.settings.getValue('user.ne_NGID', 'NGID').split(','), | |
i = 0, | |
NGIDs_length = NGIDs.length; | |
for (; i < NGIDs_length; ++i) { | |
NGIDs[i] = NGIDs[i].replace(/(?:^\s+)|(?:\s+$)/g, ''); | |
} | |
function PreProcessTimelineStatus(status) { | |
if (NGIDs.indexOf(status.user.screen_name) !== -1) { | |
status.text = status.text.replace(/./g, '*'); | |
} | |
} | |
function PreFilterProcessTimelineStatus(status) { | |
return NGIDs.indexOf(status.user.screen_name) !== -1; | |
} | |
if (System.apiLevel >= 15) { | |
TwitterService.addEventListener('preProcessTimelineStatus', PreProcessTimelineStatus); | |
TwitterService.addEventListener('preFilterProcessTimelineStatus', PreFilterProcessTimelineStatus); | |
} |
https://gist.github.com/907791/841f047eacf3b47d10376209ec9006f2e348e41d
Oh... fix misses.
Write Azurea Wiki.
[Scripts/ne_NGID - Azurea Wiki](http://azurea.refy.net/ja/wiki/index.php?cmd=read&page=Scripts%2Fne_NGID ,"")
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://gist.github.com/907791/2be58fd43c6d1e8bdb6d3de83a855f5da2b26687
Bug fix, and write @scriptUrl.