Last active
July 21, 2019 02:37
-
-
Save dataserver/dde1e39d507d7498c6a4c8abbdc1955f to your computer and use it in GitHub Desktop.
to create a bookmarklet to watch LIVE jp tv on youtube
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
var pad = function (number, digits) { | |
return Array(Math.max(digits - String(number).length + 1, 0)).join(0) + number; | |
}; | |
var d = new Date(); | |
var utc = d.getTime() + (d.getTimezoneOffset() * 60000); | |
var offset = 9; | |
var nd = new Date(utc + (3600000 * offset)); | |
var year = nd.getFullYear(), | |
month = pad(nd.getMonth() + 1, 2), | |
day = pad(nd.getDate(), 2); | |
var url=`https://www.youtube.com/results?search_query=${year}%E5%B9%B4${month}%E6%9C%88${day}%E6%97%A5&sp=EgJAAQ%253D%253D`; | |
window.location = url; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://mrcoles.com/bookmarklet/