Created
August 19, 2021 18:27
-
-
Save likev/c704d1049a1bb79460cbc9fdca0a6cca to your computer and use it in GitHub Desktop.
get weather alarm list from http://www.12379.cn
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function test(){ | |
let f = await fetch('https://icors.vercel.app/?http%3A%2F%2Fwww.12379.cn%2Fdata%2Falarm_list_all.html') | |
let d = await f.json() | |
console.log(d.alertData) | |
for(let item of d.alertData){ | |
//https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/String/includes | |
if(item.headline.includes('孟津')){ | |
console.log(item) | |
} | |
} | |
} | |
test() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment