Skip to content

Instantly share code, notes, and snippets.

@likev
Created August 19, 2021 18:27
Show Gist options
  • Save likev/c704d1049a1bb79460cbc9fdca0a6cca to your computer and use it in GitHub Desktop.
Save likev/c704d1049a1bb79460cbc9fdca0a6cca to your computer and use it in GitHub Desktop.
get weather alarm list from http://www.12379.cn
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