git clone https://codehub.roma-factory.cn-east-221.xhsseis.com/2302a96660e043d0bf82bcb907a85aac/xhcj-news-skill.git
cd xhcj-news-skill
pip install -r requirements.txt
联系管理员获取 API Key,然后配置:
python scripts/set_api_key.py --key YOUR_API_KEY
python scripts/get_recommend.py --size 5 --page 1
| 模块 | 脚本 | 功能 | 权限代码 |
|------|------|------|----------|
| 推荐资讯 | get_recommend.py | 获取推荐资讯列表 | NEWS_RECOMMEND |
| 快讯 | get_breaking.py | 获取7x24实时快讯 | NEWS_BREAKING |
| 专题 | get_topics.py | 获取专题列表/详情 | TOPIC_LIST / TOPIC_DETAIL |
| 快看 | get_brief.py | 获取快看列表 | BRIEF_LIST |
| 直播 | get_live.py | 获取直播列表 | LIVE_LIST |
| 资讯详情 | get_news_detail.py | 获取资讯详情 | NEWS_DETAIL |
# 推荐资讯
from scripts.get_recommend import get_recommend_news
result = get_recommend_news(page_size=10, page_no=1)
# 快讯
from scripts.get_breaking import get_breaking_news
result = get_breaking_news(page_size=20, page_no=1)
# 专题列表
from scripts.get_topics import get_topic_list
result = get_topic_list(page_size=10, page_no=1)
# 专题详情
from scripts.get_topics import get_topic_detail
result = get_topic_detail(zt_id="534")
# 快看列表
from scripts.get_brief import get_brief_list
result = get_brief_list(page_size=10, page_no=1)
# 直播列表
from scripts.get_live import get_live_list
result = get_live_list(page_size=10, page_no=1)
# 资讯详情
from scripts.get_news_detail import get_news_detail
result = get_news_detail(news_id="476775386999660544")
https://pictest-test.cnfic.com.cn/app-v/app-news
https://bm.cnfic.com.cn/app-news
生产环境配置:
python scripts/set_api_key.py --key YOUR_API_KEY --prod
{
"code": "0000",
"data": { ... },
"msg": "success"
}
共 1 个版本