1
0
mirror of https://github.com/oceanprotocol/community-numbers.git synced 2024-11-21 17:27:01 +01:00

Merge pull request #50 from oceanprotocol/fix-wrong-discord-number

Fix wrong discord number
This commit is contained in:
Matthias Kretschmann 2021-02-04 14:00:42 +01:00 committed by GitHub
commit c3611e29f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,9 +12,10 @@ export default async function fetchDiscord() {
// extract members count from meta description // extract members count from meta description
const metaDescription = data('meta[name="description"]').attr('content') const metaDescription = data('meta[name="description"]').attr('content')
const regex = /\d+/ // one or more digits const regex = /\d+[,]\d+/ // one or more digits separated by comma
const number = metaDescription.match(regex) const number = metaDescription.match(regex)
const members = parseInt(number[0]) const membersNumber = number[0].replace(/,/,'') // eliminate comma from number
const members = parseInt(membersNumber)
log( log(
'✓ Discord. ' + '✓ Discord. ' +