Skip to content

Commit 9511ea6

Browse files
committed
contributors : Filter bots
1 parent 6f65bea commit 9511ea6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/components/contributors.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
</div>
88
</div>
99
</div>
10-
1110
</template>
1211

1312
<script>
@@ -21,18 +20,20 @@ export default {
2120
},
2221
async mounted() {
2322
await fetch(
24-
`https://api.github.com/repos/thomasbnt/awesome-web-monetization/contributors?per_page=15`, {
23+
`https://api.github.com/repos/thomasbnt/awesome-web-monetization/contributors?per_page=30`, {
2524
headers: {
2625
'accept': 'application/vnd.github+json',
2726
'content-type': 'application/json',
2827
'Authorization': import.meta.env.GITHUB_TOKEN
2928
}
3029
})
3130
.then(async res => {
32-
this.gitContributors = await res.json()
31+
const contributors = await res.json()
32+
// if the contributor is a bot from type: "Bot", remove it from the list
33+
this.gitContributors = contributors.filter(contributor => contributor.type !== 'Bot')
34+
// And remove "thomasbnt" from the list
35+
this.gitContributors = this.gitContributors.filter(contributor => contributor.login !== 'restyled-commits')
3336
this.totalContrib = this.gitContributors.length
34-
console.log({ totalContrib: this.totalContrib })
35-
console.log({ x: this.gitContributors })
3637
})
3738
.catch(err => console.log(err))
3839
}

0 commit comments

Comments
 (0)