Merge pull request #3 from flow2000/v2

fix:更换域名
This commit is contained in:
心流 2023-05-16 00:45:44 +08:00 committed by GitHub
commit 7756bf5929
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 14 deletions

View File

@ -1,6 +1,6 @@
# 每日早报 # 每日早报
![news](https://socialify.git.ci/flow2000/news/image?description=1&descriptionEditable=60%E7%A7%92%E8%AF%BB%E6%87%82%E4%B8%96%E7%95%8C%EF%BC%8C%E6%94%AF%E6%8C%81%E4%B8%80%E9%94%AE%E9%83%A8%E7%BD%B2%EF%BC%8C%E5%BF%AB%E9%80%9F%E7%94%9F%E6%88%90%E6%8E%A5%E5%8F%A3%E6%95%B0%E6%8D%AE&font=Inter&language=1&logo=https%3A%2F%2Fnews.panghai.top%2Ffavicon.svg&name=1&owner=1&pattern=Formal%20Invitation&stargazers=1&theme=Light) ![news](https://socialify.git.ci/flow2000/news/image?description=1&descriptionEditable=60%E7%A7%92%E8%AF%BB%E6%87%82%E4%B8%96%E7%95%8C%EF%BC%8C%E6%94%AF%E6%8C%81%E4%B8%80%E9%94%AE%E9%83%A8%E7%BD%B2%EF%BC%8C%E5%BF%AB%E9%80%9F%E7%94%9F%E6%88%90%E6%8E%A5%E5%8F%A3%E6%95%B0%E6%8D%AE&font=Inter&language=1&logo=https%3A%2F%2Fnews.aqcoder.cn%2Ffavicon.svg&name=1&owner=1&pattern=Formal%20Invitation&stargazers=1&theme=Light)
### 简介 ### 简介
@ -10,11 +10,11 @@
#### v1 #### v1
![v1](https://static.panghai.top/img/screenshot/news.panghai.top-v1.png) ![v1](https://static.aqcoder.cn/img/screenshot/news.aqcoder.cn-v1.png)
#### v2 #### v2
![v2](https://static.panghai.top/img/screenshot/news.panghai.top-v2.png) ![v2](https://static.aqcoder.cn/img/screenshot/news.aqcoder.cn-v2.png)
#### Vercel 一键部署(推荐) #### Vercel 一键部署(推荐)
@ -42,7 +42,7 @@ docker run -itd --name=news --restart=always -p 9134:8888 flow2000/news:2.0.0
### API ### API
GET`https://news.panghai.top/60s`返回今日新闻json数据 GET`https://news.aqcoder.cn/60s`返回今日新闻json数据
##### 请求参数 ##### 请求参数
@ -50,17 +50,17 @@ GET`https://news.panghai.top/60s`返回今日新闻json数据
| :--------------- | :---- | :----- | :--: | :--------------------- | :--------------------- | | :--------------- | :---- | :----- | :--: | :--------------------- | :--------------------- |
| `offset` | `query` | `int` | 否 | `0` |说明:`0` 为今天,`1` 为昨天,依次类推 | | `offset` | `query` | `int` | 否 | `0` |说明:`0` 为今天,`1` 为昨天,依次类推 |
GET`https://news.panghai.top/weibo`返回微博热搜json数据 GET`https://news.aqcoder.cn/weibo`返回微博热搜json数据
##### 请求参数:无 ##### 请求参数:无
GET`https://news.panghai.top/bili`返回B站热搜json数据 GET`https://news.aqcoder.cn/bili`返回B站热搜json数据
##### 请求参数:无 ##### 请求参数:无
GET`https://news.panghai.top/bing`返回必应热搜json数据 GET`https://news.aqcoder.cn/bing`返回必应热搜json数据
##### 请求参数:无 ##### 请求参数:无
更多详情请点击:[每日早报API](https://news.panghai.top/docs) 更多详情请点击:[每日早报API](https://news.aqcoder.cn/docs)

View File

@ -52,7 +52,7 @@ async def index():
''' '''
latest_version="" latest_version=""
try: try:
latest_version=requests.get('https://static.panghai.top/txt/version/news.txt',timeout=3).text latest_version=requests.get('https://static.aqcoder.cn/txt/version/news.txt',timeout=3).text
except Exception as e: except Exception as e:
print(e) print(e)
return FlowResponse.error(msg="NEWSAPI获取不到最新版本但仍可使用请联系https://github.com/flow2000/news",data={"current_version":VERSION}) return FlowResponse.error(msg="NEWSAPI获取不到最新版本但仍可使用请联系https://github.com/flow2000/news",data={"current_version":VERSION})
@ -60,7 +60,7 @@ async def index():
"current_version":VERSION, "current_version":VERSION,
"latest_version":latest_version "latest_version":latest_version
} }
return FlowResponse.success(msg="news部署成功查看接口文档https://news.panghai.top/docs",data=data) return FlowResponse.success(msg="news部署成功查看接口文档https://news.aqcoder.cn/docs",data=data)
async def fetch(session, url): async def fetch(session, url):
async with session.get(url, verify_ssl=False) as response: async with session.get(url, verify_ssl=False) as response:

View File

@ -1,13 +1,13 @@
//时间位移0表示今天1表示昨天以此类推 //时间位移0表示今天1表示昨天以此类推
let offset = 0 let offset = 0
//获取新闻API可根据部署域名更换 //获取新闻API可根据部署域名更换
let NEWS_API = "https://news.panghai.top/60s" let NEWS_API = "https://news.aqcoder.cn/60s"
//壁纸API //壁纸API
let BINGAPI = "https://news.panghai.top/bing" let BINGAPI = "https://news.aqcoder.cn/bing"
//微博热搜API //微博热搜API
let WEIBOAPI = "https://news.panghai.top/weibo" let WEIBOAPI = "https://news.aqcoder.cn/weibo"
//B站热搜API //B站热搜API
let BILIAPI = "https://news.panghai.top/bili" let BILIAPI = "https://news.aqcoder.cn/bili"
//js入口 //js入口
get_day_news(offset); get_day_news(offset);