1
0
mirror of https://github.com/oceanprotocol/community-numbers.git synced 2025-01-03 10:25:10 +01:00

remove bounties network

This commit is contained in:
Matthias Kretschmann 2020-06-16 09:38:10 +02:00
parent 76d0f6b73b
commit e92e0d7a11
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 5 additions and 39 deletions

View File

@ -29,9 +29,7 @@ Endpoint: [`https://oceanprotocol-community.now.sh`](https://oceanprotocol-commu
"followers": 1000
},
"bounties": {
"gitcoin": 1000,
"bountiesNetwork": 1000,
"total": 1000
"gitcoin": 1000
},
"twitter": {
"followers": 1000
@ -51,7 +49,7 @@ Endpoint: [`https://oceanprotocol-community.now.sh`](https://oceanprotocol-commu
Install dependencies:
```bash
npm install -g now
npm install -g vercel
npm install
```

View File

@ -14,49 +14,17 @@ const getGitcoin = async () => {
return gitcoin.length
}
const getBountiesNetwork = async () => {
const response = await fetch('https://api.bounties.network/bounty/?search=ocean%20protocol&bountyStage=1&platform=bounties-network')
if (response.status !== 200) {
logError(`Non-200 response code from Bounties Network: ${response.status}`)
return null
}
const bountiesNetwork = await response.json()
return bountiesNetwork.results.length
}
const getTotal = async () => {
const response = await fetch('https://api.bounties.network/bounty/?search=ocean%20protocol')
if (response.status !== 200) {
logError(`Non-200 response code from Bounties Network: ${response.status}`)
return null
}
const allBounties = await response.json()
return allBounties.count
}
const fetchBounties = async () => {
const start = Date.now()
const gitcoin = await getGitcoin()
const bountiesNetwork = await getBountiesNetwork()
const total = await getTotal()
log(
'Re-built bounties cache. ' +
`Total: ${total} bounties. ` +
`Total: ${gitcoin} bounties. ` +
`Elapsed: ${new Date() - start}ms`
)
return {
gitcoin,
bountiesNetwork,
total
}
return { gitcoin }
}
module.exports = fetchBounties

View File

@ -3,7 +3,7 @@
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "now dev",
"start": "vercel dev",
"test": "eslint --ignore-path .gitignore --ext .js,.jsx ."
},
"dependencies": {