Skip to content

Commit

Permalink
change to BaiduNews API
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidDengHui committed Feb 6, 2024
1 parent eececfe commit 83d3e76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/_data/widget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ home_widget:
<div class="study-container" v-for="(item, index) in content" :key="index">
<div class="left">
<div class="order"># </div>
<div class="name"><a :href="`https://nb.ahome.eu.org/search?q=` + item.name" target="_blank" title="让 New Bing 告诉你更多!" data-fancybox data-type="iframe" data-preload="false">{{item.name}}</a></div>
<div class="name"><a :href="`https://nb.ahome.eu.org/search?q=` + item.m_title" target="_blank" title="让 New Bing 告诉你更多!" data-fancybox data-type="iframe" data-preload="false">{{item.m_title}}</a></div>
</div>
</div>
</vue-seamless-scroll>
Expand Down
6 changes: 4 additions & 2 deletions source/js/studyToday.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ new Vue({
// 请求开源api,
getWeiboList() {
// fetch("https://api.emoao.com/api/60s?type=json", {
fetch("https://tenapi.cn/v2/zhihuhot", {
// fetch("https://tenapi.cn/v2/zhihuhot", {
// fetch("https://news.baidu.com/widget?id=hotnews&ajax=json", {
fetch("https://api.hnest.eu.org/get_api?url=https%3A%2F%2Fnews.baidu.com%2Fwidget%3Fid%3Dhotnews%26ajax%3Djson", {
method: "GET", // *GET, POST, PUT, DELETE, etc.
})
.then((res) => {
return res.json();
})
.then((data) => {
this.content = data.data;
this.content = data.data.hotnews.focusNews;
})
.catch((err) => {
console.log("err", err);
Expand Down

3 comments on commit 83d3e76

@DavidDengHui
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed with

change to BaiduNews API

Following the Pages URL:

https://hnest-h43ynl0ww-daviddenghui.vercel.app

@DavidDengHui
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed with

change to BaiduNews API

Following the Pages URL:

https://hnest.eu.org/

@DavidDengHui
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed with

change to BaiduNews API

Following the Pages URL:

https://hnest.github.io/

Please sign in to comment.