Last active
August 29, 2015 13:57
-
-
Save kkotaro0111/9384194 to your computer and use it in GitHub Desktop.
Youtubeの動画管理ページから、各動画の経過日数と1日あたりの再生数を表示する。consoleにコピペして、addinfo()を呼ぼう。
This file contains hidden or 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(){ | |
| //load jQuery | |
| var loadjq = document.createElement("script"); | |
| loadjq.type = "text/javascript"; | |
| loadjq.src = "//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"; | |
| document.body.appendChild(loadjq); | |
| })(); | |
| function addinfo(){ | |
| var vi = $(".vm-video-item"); | |
| var today = new Date(); | |
| vi.each(function(index, elem){ | |
| var ld = $(elem).find(".vm-video-info").find(".localized-date"); | |
| var ldstmp = ld.data("timestamp"); | |
| var lddate = new Date(ldstmp*1000); | |
| var title = $(elem).find(".vm-video-title-content").text(); | |
| var diftime = Math.round((today.getTime() - ldstmp*1000) / 1000 / 60 / 60 / 24); | |
| var playedNum = $(elem).find(".video-view-count").find(".vm-video-metric-value"); | |
| var playedNumValue = playedNum.text().replace(/,/,"") << 0; | |
| ld.after(" / " + diftime + "日前"); | |
| playedNum.after(" / " + Math.ceil(playedNumValue / diftime)); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment