Skip to content

Instantly share code, notes, and snippets.

@dataserver
Last active July 21, 2019 02:37
Show Gist options
  • Save dataserver/dde1e39d507d7498c6a4c8abbdc1955f to your computer and use it in GitHub Desktop.
Save dataserver/dde1e39d507d7498c6a4c8abbdc1955f to your computer and use it in GitHub Desktop.
to create a bookmarklet to watch LIVE jp tv on youtube
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;
@dataserver
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment