ぽっぺん日記@karashi.org
2008-02-04(Mon) [長年日記]
_ [greasemonkey]amazonwishlistbookoff.user.jsのパッチを書いたよ
非常に便利に使わさせていただいている amazonwishlistbookoff.user.js なんだけども、価格が1000円を超える本はブックオフオンラインから引っ張ってこないバグがあったのでパッチを書いた。
以下、1行パッチ。
--- amazonwishlistbookoff.user.js.orig Sat Jan 12 16:27:18 2008
+++ amazonwishlistbookoff.user.js Mon Feb 4 21:46:34 2008
@@ -65,7 +65,7 @@
onload:function(response){
var usedLink = document.createElement('a');
usedLink.setAttribute('href', targetURL + isbn);
- if(response.responseText.match(/中古販売価格<\/th><td class="tab01">¥(\d+)(税込)/)){
+ if(response.responseText.match(/中古販売価格<\/th><td class="tab01">¥(\d[\d\,]+)(税込)/)){
usedLink.innerHTML = "¥" + RegExp.$1;
usedLink.setAttribute('style', 'color:#B22222;font-weight:bold;');
}else{
1000円を超えると、
¥1,000
のような感じで、カンマが入るので、それに対処しただけ。
[ツッコミを入れる]
