Skip to content

Instantly share code, notes, and snippets.

@WietseWind
Last active January 29, 2023 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WietseWind/84247057280279a0a2e80ff2771e2fc8 to your computer and use it in GitHub Desktop.
Save WietseWind/84247057280279a0a2e80ff2771e2fc8 to your computer and use it in GitHub Desktop.
Update electric-capital/crypto-ecosystems with up to date XRPL repos
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