Giter VIP home page Giter VIP logo

pneumonia's Introduction

pneumonia

抓取 丁香园 以及nCoV2019 的实时疫情数据,并发送邮件提醒。

思路

丁香园

由于丁香园的这个页面,将所有的数据通过服务端渲染,直接写在了具体的 script 标签里面,所以直接从 js 文件解析实时数据, 不需要去遍历查找每个 html 的 tag. 执行效率要一点。

telegram nCoV2019

抓取这个频道的数据需要科学上网。

其他

以上两个数据源都封装成HTML文本,然后写入模板文件,转换成字符,使用 spring mail 发送邮件。

quickstart

按规则修改配置文件

# 这里按照spring mail 的配置就行,注意password是你的网易邮箱授权码
spring:
  mail:
    host: smtp.163.com
    username: [email protected]
    password: xxxx
    default-encoding: UTF-8

send:
  mail:
    cron: 0/30 * * * * ? # 抓取频率
    to: [email protected],[email protected] # 需要发送的邮箱,逗号隔开

这里的抓取频率最好不要设置太快,避免给丁香园造成过多不必要的压力。

然后按照常规的springboot项目启动即可。

备注

为武汉加油!

pneumonia's People

Contributors

leongravel avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.