Giter Site home page Giter Site logo

dailyreport's People

Contributors

rapiz1 avatar winderica avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dailyreport's Issues

tesseract.js 数据下载过慢

我目前的 workaround 是将数据提前下载好,然后将

const worker = createWorker()

改为

const worker = createWorker({
  langPath: '.',
})

或许可以改成这样,然后在 README 里面说明一下。

如果可以的话,我去开一个 PR。

Error caused by the new API

...and Response cannot be serialized by JSON.stringify

(node:4001) UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'TLSSocket'
    |     property '_httpMessage' -> object with constructor 'ClientRequest'
    --- property 'socket' closes the circle
    at JSON.stringify (<anonymous>)
    at doAction (/path/to/DailyReport/src/index.js:82:59)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async submit (/path/to/DailyReport/src/index.js:90:12)
    at async fuck (/path/to/DailyReport/src/index.js:159:26)

发现一个或许有用的API

我注意到, https://health.hust.edu.cn/new_jp/jp/home/getRedPoint这个API可以检测, 这个学生这一天有没有提交成功. 它返回当天提交过体温的次数, 或许会有用.
这个API是在这里发现的, 华科官方用的解析代码如下(就是RECORD TIME有用)

//判断是否需要健康上报
Util.ajax({
    url : contextpath+"/jp/home/getRedPoint",//后台的请求路径
    param :{} ,
    success : function(data){
        if (data.ID_TYPE == '1'||data.ID_TYPE == '2'||data.ID_TYPE == '3' ){
            if (data.RECORD_TIMES > 0){
                $("#redpoint").hide();
                $("#day-health").unbind("click").click(function(){
                    Msg.error('今日已上报!');
                });
                $("#redpoint_h").hide();
            }else{
                $("#day-health").unbind("click").click(function(){
                    window.location.href=css_path+"/h6?m=jp#act=jp/healthreport";
                });
                $("#redpoint").show();
                $("#redpoint_h").show();
            }
        }else {
            if (data.RECORD_TIME > 0){
                $("#redpoint").hide();
                $("#redpoint_h").hide();
                $("#day-health").unbind("click").click(function(){
                    Msg.error('今日已上报!');
                });
            }else{
                $("#day-health").unbind("click").click(function(){
                    window.location.href=css_path+"/h6?m=jp#act=jp/temporary";
                });
                $("#redpoint").show();
                $("#redpoint_h").show();
            }
        }
    }
});

附送一个HAR.
hust-ncov-detect.har.txt

tesseract的一些问题

  1. tessedit_char_whitelist在tesseract v4下是无效选项,需要使用v3。worker.initialize("eng", OEM.TESSERACT_ONLY) #203
  2. PSM.SINGLE_LINE虽然不会出现换行,但是仍然会偶有识别出空格的情况。这种情况要处理一下。
  3. 训练集不挂代理基本下载不下来,可以换一个url。腾讯云的cos可以白嫖50G,我把训练集放上去了。
const worker = createWorker({
  langPath: "https://file-1252889006.cos.ap-guangzhou.myqcloud.com/tesseract",
});
await worker.load();
await worker.loadLanguage("eng");
await worker.initialize("eng", OEM.TESSERACT_ONLY);
await worker.setParameters({
  tessedit_pageseg_mode: PSM.SINGLE_LINE,
  tessedit_char_whitelist: "0123456789",
});

UnhandledPromiseRejectionWarning

npm node-fetch
// create config.json
node main

tried it both using config.json and set config directly. But both complain a error following.

➜  DailyReport git:(master) ✗ node main
(node:5164) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'Symbol(Request internals)' of null
    at isRequest (/Volumes/MacWorkplace/Github/DailyReport/node_modules/node-fetch/lib/index.js:1152:50)
    at new Request (/Volumes/MacWorkplace/Github/DailyReport/node_modules/node-fetch/lib/index.js:1174:8)
    at /Volumes/MacWorkplace/Github/DailyReport/node_modules/node-fetch/lib/index.js:1403:19
    at new Promise (<anonymous>)
    at fetch (/Volumes/MacWorkplace/Github/DailyReport/node_modules/node-fetch/lib/index.js:1401:9)
    at get (/Volumes/MacWorkplace/Github/DailyReport/main.js:63:49)
    at login (/Volumes/MacWorkplace/Github/DailyReport/main.js:106:11)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async fuck (/Volumes/MacWorkplace/Github/DailyReport/main.js:263:5)
(node:5164) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:5164) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

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.