fix: date format
This commit is contained in:
parent
bca668ef72
commit
3075a0499e
20 changed files with 53 additions and 118 deletions
|
@ -1,18 +1,14 @@
|
|||
import EleventyFetch from '@11ty/eleventy-fetch'
|
||||
|
||||
export default async function () {
|
||||
const API_KEY_FATHOM = process.env.API_KEY_FATHOM
|
||||
const url =
|
||||
'https://api.usefathom.com/v1/aggregations?entity=pageview&entity_id=CWSVCDJC&aggregates=pageviews&field_grouping=pathname&sort_by=pageviews:desc&limit=10'
|
||||
const SITE_ID_CLICKY = process.env.SITE_ID_CLICKY
|
||||
const SITE_KEY_CLICKY = process.env.SITE_KEY_CLICKY
|
||||
const url = `https://api.clicky.com/api/stats/4?site_id=${SITE_ID_CLICKY}&sitekey=${SITE_KEY_CLICKY}&type=pages&output=json`
|
||||
const res = EleventyFetch(url, {
|
||||
duration: '1h',
|
||||
type: 'json',
|
||||
fetchOptions: {
|
||||
headers: {
|
||||
Authorization: `Bearer ${API_KEY_FATHOM}`,
|
||||
},
|
||||
},
|
||||
}).catch()
|
||||
const pages = await res
|
||||
return pages.filter((p) => p.pathname.includes('posts'))
|
||||
const data = await res
|
||||
const pages = data[0].dates[0].items
|
||||
return pages.filter((p) => p.url.includes('posts'))
|
||||
}
|
Reference in a new issue