Last active
October 13, 2023 01:41
-
-
Save hyrious/35f7e2e271b76126068b0d25b9b65332 to your computer and use it in GitHub Desktop.
Who Starred Me - GitHub RSS
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
// ==UserScript== | |
// @name Who Starred Me - GitHub RSS | |
// @namespace star-rss.hyrious.me | |
// @match https://github.com/*.private.atom | |
// @grant none | |
// @version 1.0 | |
// @author hyrious | |
// @description Because refined github hides them. | |
// ==/UserScript== | |
(async () => { | |
Object.assign(document.documentElement.dataset, { | |
colorMode: 'auto', | |
lightTheme: 'light', | |
darkTheme: 'dark', | |
}) | |
const user = location.pathname.slice(1).split('.')[0] | |
const index = await fetch('/').then(r => r.text()) | |
index.replace(/ href="(.+?\.css)"/g, (t, css) => { | |
const el = document.createElement('link') | |
el.rel = 'stylesheet' | |
el.href = css | |
document.head.append(el) | |
}) | |
document.head.appendChild(document.createElement('style')).textContent = 'body { padding: 50px 30px }' | |
const filtered = [] | |
const raw = document.querySelector('pre').textContent | |
const root = new DOMParser().parseFromString(raw, 'application/xml') | |
for (const entry of root.querySelectorAll('entry')) { | |
if (entry.querySelector('title').textContent.includes(' starred ' + user + '/')) { | |
filtered.push(entry) | |
} | |
} | |
let html = '' | |
for (const entry of filtered) { | |
html += entry.querySelector('content').textContent | |
} | |
document.body.innerHTML = html | |
})(); |
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
// ==UserScript== | |
// @name Read on GitHub RSS | |
// @namespace gh-rss.hyrious.me | |
// @match https://github.com/*.atom | |
// @grant none | |
// @version 1.0 | |
// @author hyrious | |
// @description Because github new dashboard is terrible. | |
// ==/UserScript== | |
(async () => { | |
Object.assign(document.documentElement.dataset, { | |
colorMode: 'auto', | |
lightTheme: 'light', | |
darkTheme: 'dark', | |
}) | |
const user = location.pathname.slice(1).split('.')[0] | |
const index = await fetch('/').then(r => r.text()) | |
index.replace(/ href="(.+?\.css)"/g, (t, css) => { | |
const el = document.createElement('link') | |
el.rel = 'stylesheet' | |
el.href = css | |
document.head.append(el) | |
}) | |
document.head.appendChild(document.createElement('style')).textContent = 'body { padding: 50px 30px }' | |
const filtered = [] | |
const raw = document.querySelector('pre').textContent | |
const root = new DOMParser().parseFromString(raw, 'application/xml') | |
let html = '' | |
for (const entry of root.querySelectorAll('entry')) { | |
html += entry.querySelector('content').textContent | |
} | |
document.body.innerHTML = html | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment