- Adjust code as necessary
- Convert code to a Bookmarklet using this tool: https://chriszarate.github.io/bookmarkleter/
- Add to Chrome by following instructions here: https://www.freecodecamp.org/news/what-are-bookmarklets/
Last active
February 7, 2024 21:45
-
-
Save shcallaway/0e773e49a8a36f1d76320b966252fa4a to your computer and use it in GitHub Desktop.
Chrome Bookmarklet that opens GitHub commits merged to master over the past week for a particular repo
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
console.log("Running bookmarklet...") | |
// Replace this with your repo URL | |
var repoUrl = "https://github.com/opkit-co/opkit" | |
var d = new Date(); | |
d.setDate(d.getDate() - 7); | |
let dayOfMonth = d.getDate().toString(); | |
// Pad with leading zero | |
if (dayOfMonth.length < 2) { | |
dayOfMonth = `0${dayOfMonth}` | |
} | |
// Fix zero-indexing | |
let monthOfYear = (d.getMonth() + 1).toString(); | |
// Pad with leading zero | |
if (monthOfYear.length < 2) { | |
monthOfYear = `0${monthOfYear}` | |
} | |
// Hardcode master branch and current year :P | |
var completeUrl = `${repoUrl}/commits/master/?since=2024-${monthOfYear}-${dayOfMonth}` | |
console.log(`Navigating to: ${completeUrl}`); | |
window.open(completeUrl); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment