The resource loading... loading...

FMZ with temperature

Author: fmzero, Created: 2020-01-24 14:23:17, Updated:

Viruses are ruthless, people are loving. FMZ has always been sympathetic. I've been doing live updates on the outbreak, and I wanted to share with FMZ what I've learned about the outbreak.HttpQueryWe are also able to crawl real-time information and push it to the WeChat public domain using Log...& to display the information using LogStatus (some say it may not be useful). This is the temperature. The following code failed to implement the regular expression filter message, and is only a semi-finished product.

The temperature

var url = 'https://3g.dxy.cn/newh5/view/pneumonia'
var newsRegex = "/<script id=\"getTimelineService\">.+?window.getTimelineService\s=\s({.+?)}catch\(e\){}<\/script>/im"
var provinceRegex = "/<script id=\"getListByCountryTypeService1\">.+?window.getListByCountryTypeService1\s=\s(\[.+?])}catch\(e\){}<\/script>/im"

///////////////////////////////////////////
function get_dxy_data() {
    var ret = HttpQuery(url)
    return ret
}

function get_nCoV_news(content ) {
    var news = content.match(newsRegex)
    Log(news)
}

function get_nCoV_province(content) {
    var ret = HttpQuery(url)
    var province = ret.search(provinceRegex)
    Log(province)

}

function main() {
    while(true) {
        Sleep(10 * 1000)
        var content = get_dxy_data()
        if(content === null) {
            continue
        }
        get_nCoV_news(content)
        get_nCoV_province(content)
    }
}

More

The grassThe elderly are cooler.

ChaoZhangThis can be

fmzeroI'm in an area where the epidemic is spreading, and I check daily to see if anyone is replying.

fmzeroFinally, someone came and, with the help of God, modified the code, perfected the correct expression.