Last active
January 29, 2023 00:04
-
-
Save WietseWind/84247057280279a0a2e80ff2771e2fc8 to your computer and use it in GitHub Desktop.
Update electric-capital/crypto-ecosystems with up to date XRPL repos
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
import fetch from 'node-fetch' | |
const repos = [] | |
const knownRepoCall = await fetch('https://raw.githubusercontent.com/electric-capital/crypto-ecosystems/master/data/ecosystems/x/xrp.toml') | |
const knownRepoData = await knownRepoCall.text() | |
for (let page = 1; page < 10; page++) { | |
const call = await fetch('https://api.github.com/search/repositories?q=xrp+xrpl&order=desc&per_page=1000&page=' + page) | |
const json = await call.json() | |
if (json.items.length < 1) { | |
break; | |
} | |
console.log('Page', page) | |
json.items | |
.filter(j => !j.private) | |
.filter(j => !j.archived) | |
.filter(j => !j.disabled) | |
.filter(j => j.watchers > 1) | |
.filter(j => !j.fork) | |
.filter(j => j.html_url.toLowerCase().match(/ripple|xrp|bithomp/)) | |
.map(j => j.html_url) | |
.filter(j => !knownRepoData.match(j)) | |
.forEach(j => repos.push(j)) | |
} | |
console.log(repos.map(j => ` | |
[[repo]] | |
url = "${j}"`)).join('')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment