Type/to search
17
Follow
35
Followers
Faça FMZ com calor
Help
Created 2020-01-24 14:23:17  
 4
 1746

O vírus é implacável, mas o amor é humano.
A FMZ sempre teve sentimentos.
O Jardim de Cingaceiros está fazendo uma publicação em tempo real sobre a evolução da epidemia, e eu gostaria de compartilhar com vocês o que aconteceu na FMZ.HttpQueryA partir daí, o usuário pode crawlar informações em tempo real e enviá-las para o público do WeChat usando o Log[...]...&, e usar o LogStatus para exibir informações (alguns dizem que talvez não seja necessário).
É a temperatura.
O seguinte código não consegue implementar filtragem de expressões regulares, e é apenas um meio-produto.

Temperatura

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) } }
Related Recommendations
Comment
All comments (4)

    过年的人比较冷清

    7 years ago

    身在疫情区,天天看有没有人回帖。。。

    7 years ago

    这个可以

    7 years ago

    终于有人来了,待大神神助攻,修改一下代码,完善正则表达式。谢谢

    7 years ago
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)