Download wp-calypso/client/dashboard/data/site-stats.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 511 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/dashboard/data/site-stats.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/dashboard/data/site-stats.ts
-
curl -L -o site-stats.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/dashboard/data/site-stats.ts
511 Bytes
| import wpcom from 'calypso/lib/wp'; | |
| export interface EngagementStatsDataPoint { | |
| visitors: number; | |
| views: number; | |
| likes: number; | |
| comments: number; | |
| } | |
| export interface EngagementStats { | |
| currentData: EngagementStatsDataPoint; | |
| previousData: EngagementStatsDataPoint; | |
| } | |
| export async function fetchSiteEngagementStats( siteId: number ) { | |
| return wpcom.req.get( `/sites/${ siteId }/stats/visits`, { | |
| unit: 'day', | |
| quantity: 14, | |
| stat_fields: [ 'visitors', 'views', 'likes', 'comments' ].join( ',' ), | |
| } ); | |
| } | |