// On this URL // https://github.com/markerikson/redux-ecosystem-links/blob/master/routing.md // or this: // https://github.com/MicheleBertoli/css-in-js // or any place with links to a github repo; // go to developer console and run: const fetchStars = url => { const [, user, repo] = url.match(/https:\/\/github.com\/([^\/]*)\/(.*)\/?$/); return fetch(`https://api.github.com/repos/${user}/${repo}`) .then(response => response.json()) .then(data => { if (data.message && data.message.startsWith('API rate limit exceeded')) { return 'API rate limit exceeded' } else { return data.stargazers_count } }) .catch(error => console.log(error)) } const bigList = Array.from(document.querySelectorAll('#readme a')) .filter(a => /^https:\/\/github/.test(a.getAttribute('href'))); bigList.map(a => { const url = a.getAttribute('href'); fetchStars(url).then(stars => a.insertAdjacentHTML('beforeEnd', ` ★ ${stars}`) ) })