mirror of
https://github.com/oceanprotocol/community-numbers.git
synced 2024-11-22 01:37:02 +01:00
Merge pull request #50 from oceanprotocol/fix-wrong-discord-number
Fix wrong discord number
This commit is contained in:
commit
c3611e29f3
@ -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. ' +
|
||||||
|
Loading…
Reference in New Issue
Block a user