Skip to content

Instantly share code, notes, and snippets.

@novi novi/gist:5977158
Last active Dec 19, 2015

Embed
What would you like to do?
片仮名と平仮名を抜くブックマークレット。140文字は無理だった。
javascript:o='childNodes';p='nodeValue';function%20m(n){var%20c=n[o];for(i%20in%20c){e=c[i];e.nodeType==3&&(e[p]=e[p].replace(/[ぁ-んァ-ヶー]/g,''));e[o]&&m(e)}}m(document)
Yahoo ニュースの例 http://twitpic.com/d23do7
1文字コードずらす
javascript:o='childNodes';p='nodeValue';function%20m(n)%7Bvar%20c=n%5Bo%5D;for(i%20in%20c)%7Be=c%5Bi%5D;e.nodeType==3&&(e%5Bp%5D=e%5Bp%5D.replace(/%5B%E3%81%81-%E3%82%93%E3%82%A1-%E3%83%B6%5D/g,function(a,b)%7breturn%20String.fromCharCode(a.charCodeAt(0)-1)%7d));e%5Bo%5D&&m(e)%7D%7Dm(document)
平仮名片仮名交換
javascript:o='childNodes';p='nodeValue';function m(n){var c=n[o];for(i in c){e=c[i];e.nodeType==3&&(e[p]=e[p].replace(/([ぁ-ん])|([ァ-ヶ])/g,function(a,b){return String.fromCharCode(a.charCodeAt(0)+(b?0x60:-0x60))}));e[o]&&m(e)}}m(document)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.