1
0
mirror of https://github.com/oceanprotocol/community-numbers.git synced 2024-12-22 09:13:24 +01:00

fixed wrong discord members value

This commit is contained in:
Norbi 2021-02-04 13:11:07 +02:00
parent e4b5f3b552
commit ec03e58149

View File

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