I used jquery. We will use jQuery Injector
chrome extension to load jQuery.
- Install https://chrome.google.com/webstore/detail/jquery-injector/ekkjohcjbjcjjifokpingdbdlfekjcgi?hl=en
- Go to extension options and use this
https://code.jquery.com/jquery-3.5.0.min.js
for url. - Go to your commit page of specific branch.
- Open
console
and paste the following code.
var commits = $(".TimelineItem.TimelineItem--condensed:first-child").children(".TimelineItem-body").children("ol").children();
const date = new Date(); // get the current date
const day = date.getDate(); // get the day of the month
const monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
const month = monthNames[date.getMonth()]; // get the month name
const year = date.getFullYear(); // get the year
// Add ordinal suffix to day
let suffix;
switch (day) {
case 1:
case 21:
case 31:
suffix = 'st';
break;
case 2:
case 22:
suffix = 'nd';
break;
case 3:
case 23:
suffix = 'rd';
break;
default:
suffix = 'th';
}
const formattedDate = `${day}${suffix} - ${month} ${year}`;
var activities = `Dear Sir,
Today's (${formattedDate}) activities are -
`;
$.each(commits, function(index, commit) {
let text = $(commit).children("div:first-child").children("p:first-child").children("a").html();
let url = "https://github.com"+$(commit).children("div:first-child").children("p:first-child").children("a").attr("href");
activities += (index + +1)+". "+text+" ["+url+"]\n"
});
const textarea = document.createElement('textarea');
textarea.value = activities;
// Add the textarea element to the DOM
document.body.appendChild(textarea);
// Select the contents of the textarea
textarea.select();
// Copy the selected text to the clipboard
document.execCommand('copy');
// Remove the textarea element from the DOM
document.body.removeChild(textarea);
alert("Copied and ready to be pasted")
Expected output:
1. Profitability Report PDF Done https://github.com/magnetismtech/hr-lines/commit/aa85c6
2. Profitability Report PDF Done https://github.com/magnetismtech/hr-lines/commit/0321d0
3. not sure what did I mess https://github.com/magnetismtech/hr-lines/commit/41ec8809f7a
4. Expense Schedule Summation Added https://github.com/magnetismtech/hr-lines/commit/40e
5. Expense Invoices Delete https://github.com/magnetismtech/hr-lines/commit/5ea108484267
Then you can use chatgpgt to format this. Or you can improve the script.
- Format for gmail [90% Done]