您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
在BI4Sight页面侧边栏菜单中注入时间区间选择面板,快速切换常用时间区间并刷新数据
BI4Sight时间区间选择助手是一个专为BI4Sight系统开发的用户脚本,旨在解决跨时区工作场景下的时间区间选择问题。该插件提供了便捷的时间区间切换功能,并集成了基于北京时间的工作状态提醒。
基于北京时间显示不同工作状态的趣味文案:
时间段 | 文案 | 颜色 |
---|---|---|
10:00-10:50 | 💪 开始爆肝! | 蓝色 |
10:50-11:00 | 🍱 记得点外卖! | 橙色 |
11:00-12:00 | 💪 开始爆肝! | 蓝色 |
12:00-13:30 | 😴 休息时间! | 绿色 |
13:30-14:00 | 💪 继续爆肝! | 蓝色 |
14:00-16:00 | ⏰ 转点:还有X:X:X | 橙色 |
16:00-18:00 | 💪 继续爆肝! | 蓝色 |
18:00-18:30 | ⏰ 1小时下班! | 橙色 |
18:30-19:00 | ⏰ 半小时下班! | 红色 |
19:00-2:00 | 🌙 加班中! | 红色 |
bi4sight-datezone-helper.user.js
文件内容复制粘贴到编辑器中Ctrl+S
保存脚本bi4sight-datezone-helper.user.js
文件工作台界面 - 时间助手面板显示在侧边栏下方
数据查看界面 - 时间助手与数据面板协同工作
时间西八区/
├── bi4sight-datezone-helper.user.js # 主脚本文件
├── README.md # 项目说明文档
└── 接口交互说明.md # API接口说明
如需添加新的时间区间或功能,可以修改以下部分:
// 在 dateOptions 数组中添加新选项
{
label: '自定义区间',
date_type: 'custom',
getRange: () => {
// 自定义时间区间逻辑
return {
start: formatDate(startDate),
stop: formatDate(endDate),
startPST: toPSTDateString(startDate),
stopPST: toPSTDateString(endDate)
};
}
}
// 在 API_CONFIG 对象中添加新接口
newApi: {
url: 'https://api.bi4sight.com/api/axs/your/endpoint',
buildBody: (date_type, range) => ({
date_range: { date_type, start: range.start, stop: range.stop },
// 其他参数
})
}
// 在 startTimezoneClock 函数中修改恶趣味文案逻辑
if (h >= 10 && h < 12) {
// 自定义时间段和文案
msg = '你的自定义文案';
cls = 'blue';
}
这些API接口是通过以下方式获得的:
浏览器开发者工具:
具体操作步骤:
POST https://api.bi4sight.com/api/axs/workbench/ax/global/card
功能:获取全局卡片数据,包括素材ARPU、花费、CTR等关键指标
请求体示例:
{
"platform": "META",
"date_range": {
"date_type": "today",
"start": "2024-07-06",
"stop": "2024-07-06"
},
"metrics": [
"material_arpu",
"spend",
"ctr",
"cpcvt",
"cvr"
]
}
POST https://api.bi4sight.com/api/axs/workbench/material/mine
功能:获取我的素材列表数据
请求体示例:
{
"date_range": {
"date_type": "today",
"start": "2024-07-06",
"stop": "2024-07-06"
}
}
POST https://api.bi4sight.com/api/axs/product/set/field/list
功能:获取产品字段配置信息
请求体示例:
{
"platform": "META",
"business_type": "MATERIAL_REPORT"
}
POST https://api.bi4sight.com/api/axs/material/reporting
功能:获取详细的素材报表数据
请求体示例:
{
"page": 1,
"page_size": 20,
"product_id": null,
"date_range": {
"start": "2024-07-06",
"stop": "2024-07-06"
},
"platform": "META",
"sorting": {
"field": "spend",
"direction": "desc"
},
"metrics": [
"spend", "spend_percent", "publish_count", "material_arpu",
"action:bi_video_continuous_2", "action:bi_video_continuous_2:cost",
"action:bi_video_p75", "action:bi_video_p75:cost", "impressions",
"clicks", "converts", "cpc", "cpcvt", "ecpm", "ctr", "cvr",
"action:bi_total_purchase", "action:bi_total_purchase:cost",
"action_value:bi_total_purchase", "action_value:bi_total_purchase:roi"
],
"group_tag": "MaterialName"
}
插件会自动从以下位置提取认证信息:
认证Headers示例:
{
'accept': 'application/json, text/plain, */*',
'content-type': 'application/json',
'language': 'zh',
'tenant-id': 'your_tenant_id',
'user-token': 'your_user_token',
'version': 'your_version'
}
API_CONFIG
对象中添加新的接口配置fetchAllApisV2
函数中调用新接口添加新接口示例:
const API_CONFIG = {
// ... 现有接口
newApi: {
url: 'https://api.bi4sight.com/api/axs/your/new/endpoint',
buildBody: (date_type, range) => ({
// 你的请求体配置
date_range: { date_type, start: range.start, stop: range.stop }
})
}
};
欢迎提交Issue和Pull Request来改进这个项目!
本项目采用 MIT 许可证,详见 LICENSE 文件。
感谢BI4Sight团队提供的优秀平台,以及所有为这个项目做出贡献的开发者。
注意:此插件仅供学习和工作使用,请遵守BI4Sight平台的使用条款。
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址