mirror of
https://github.com/oceanprotocol/community-numbers.git
synced 2025-01-07 04:04:23 +01:00
consolidate utils
This commit is contained in:
parent
c37b5509b9
commit
34e5a0b257
@ -1,5 +1,5 @@
|
|||||||
const fetch = require('node-fetch')
|
const fetch = require('node-fetch')
|
||||||
const { log, logError } = require('../util/logger')
|
const { log, logError } = require('../utils')
|
||||||
|
|
||||||
const getGitcoin = async () => {
|
const getGitcoin = async () => {
|
||||||
const response = await fetch('https://gitcoin.co/api/v0.1/bounties/?&org=oceanprotocol&is_open=true')
|
const response = await fetch('https://gitcoin.co/api/v0.1/bounties/?&org=oceanprotocol&is_open=true')
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const fetch = require('node-fetch')
|
const fetch = require('node-fetch')
|
||||||
const { log, logError } = require('../util/logger')
|
const { log, logError, arrSum } = require('../utils')
|
||||||
|
|
||||||
// Request options for all fetch calls
|
// Request options for all fetch calls
|
||||||
const options = {
|
const options = {
|
||||||
@ -10,8 +10,6 @@ const options = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const arrSum = arr => arr.reduce((a, b) => a + b, 0)
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Fetch all public GitHub repos
|
// Fetch all public GitHub repos
|
||||||
//
|
//
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const fetch = require('node-fetch')
|
const fetch = require('node-fetch')
|
||||||
const { log, logError } = require('../util/logger')
|
const { log, logError } = require('../utils')
|
||||||
|
|
||||||
const fetchMedium = async () => {
|
const fetchMedium = async () => {
|
||||||
const url = 'https://medium.com/oceanprotocol?format=json'
|
const url = 'https://medium.com/oceanprotocol?format=json'
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
const fetch = require('node-fetch')
|
const fetch = require('node-fetch')
|
||||||
const { log, logError } = require('../util/logger')
|
const { log, logError } = require('../utils')
|
||||||
|
|
||||||
const fetchTwitter = async () => {
|
const fetchTwitter = async () => {
|
||||||
const url = 'https://cdn.syndication.twimg.com/widgets/followbutton/info.json?screen_names=oceanprotocol'
|
const url = 'https://cdn.syndication.twimg.com/widgets/followbutton/info.json?screen_names=oceanprotocol'
|
||||||
|
@ -4,4 +4,6 @@ const chalk = require('chalk')
|
|||||||
const log = text => console.log(text)
|
const log = text => console.log(text)
|
||||||
const logError = text => console.error(chalk.bold.red(text))
|
const logError = text => console.error(chalk.bold.red(text))
|
||||||
|
|
||||||
module.exports = { log, logError }
|
const arrSum = arr => arr.reduce((a, b) => a + b, 0)
|
||||||
|
|
||||||
|
module.exports = { log, logError, arrSum }
|
Loading…
Reference in New Issue
Block a user