ピヨピヨ日記ブックマークレット
こちらをつかうようにした!
code:js
var today = new Date();
var tYear = String(today.getFullYear());
var tMonth = ('00' + (today.getMonth() + 1)).slice(-2);
var tDay = ('00' + today.getDate()).slice(-2);
var todayStr = tYear + tMonth + tDay;
var dateInput = window.prompt("Enter YYYYMMDD", todayStr);
var yyyy = Number(dateInput.substr(0, 4));
var mm = Number(dateInput.substr(4, 2));
var dd = Number(dateInput.substr(6, 2));
var date = new Date(yyyy, mm-1, dd);
var year = String(date.getFullYear());
var month = ('00' + (date.getMonth() + 1)).slice(-2);
var monthStr = 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'date.getMonth(); var day = ('00' + date.getDate()).slice(-2);
var title = ピヨピヨ日記 ${year}/${month}/${day};
var body = encodeURIComponent(\n\n\n#${year} #${monthStr} #${day} #${dow}\n#${month}/${day}\n#${year}/${month}/${day}\n#ピヨピヨ日記);
var url = baseurl + title + '?body=' + body;
window.open(url);
code:bookmarklet
javascript:var today = new Date();var tYear = String(today.getFullYear());var tMonth = ('00' + (today.getMonth() + 1)).slice(-2);var tDay = ('00' + today.getDate()).slice(-2);var todayStr = tYear + tMonth + tDay;var dateInput = window.prompt("Enter YYYYMMDD", todayStr);var yyyy = Number(dateInput.substr(0, 4));var mm = Number(dateInput.substr(4, 2));var dd = Number(dateInput.substr(6, 2));var date = new Date(yyyy, mm-1, dd);var baseurl = 'https://scrapbox.io/piyopiyo/';var year = String(date.getFullYear());var month = ('00' + (date.getMonth() + 1)).slice(-2);var monthStr = 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'date.getMonth();var day = ('00' + date.getDate()).slice(-2);var dow = 'Sun','Mon','Tue','Wed','Thu','Fri','Sat'date.getDay();var title = ピヨピヨ日記 ${year}/${month}/${day};var body = encodeURIComponent(\n\n\n#${year} #${monthStr} #${day} #${dow}\n#${month}/${day}\n#${year}/${month}/${day}\n#ピヨピヨ日記);var url = baseurl + title + '?body=' + body;window.open(url);