Last active
December 24, 2015 18:08
-
-
Save donayama/6840493 to your computer and use it in GitHub Desktop.
MyKindleをChromeで開いて、JSConsoleで実行すると日別の購入冊数が取得できるでござる。
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
(function(){ | |
var counter = {}; | |
var page = {now: 1, max: pageList.pages}; | |
var parseList = function(){ | |
var nodeList = $$('tr.rowHeaderCollapsed td.greyed'); | |
for(var i = 1; i < nodeList.length; i = i + 2){ | |
if(nodeList[i] != null){ | |
var ymd = nodeList[i].innerText; | |
if(!counter[ymd]){ | |
counter[ymd] = 0; | |
} | |
counter[ymd]++; | |
} | |
}; | |
if(page.now < page.max){ | |
page.now++; | |
pageList.gotopage(page.now); | |
setTimeout(function(){ | |
parseList(); | |
},1500); | |
} | |
else{ | |
var result = ''; | |
var counter2 = 0; | |
var keys = Object.keys(counter); | |
for(var j = keys.length - 1; j > 0; j--){ | |
counter2 += counter[keys[j]]; | |
result += keys[j] + "\t" + counter2 + "\n"; | |
} | |
window.prompt("copy text", result); | |
} | |
}; | |
parseList(); | |
})(); |
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
// タイトル一覧 | |
(function(){ | |
var page = {now: 1, max: pageList.pages}; | |
var parseList = function(){ | |
var nodeList = $$('tr.rowHeaderCollapsed span.headerTitle'); | |
for(var i = 1; i < nodeList.length; i = i + 1){ | |
if(nodeList[i] != null){ | |
console.log(nodeList[i].innerText); | |
} | |
}; | |
if(page.now < page.max){ | |
page.now++; | |
pageList.gotopage(page.now); | |
setTimeout(function(){ | |
parseList(); | |
},1500); | |
} | |
else{ | |
alert('done'); | |
} | |
}; | |
parseList(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment