winderica / dailyreport Goto Github PK
View Code? Open in Web Editor NEWSubmit your health status to your fucking department everyday
License: MIT License
Submit your health status to your fucking department everyday
License: MIT License
我目前的 workaround 是将数据提前下载好,然后将
const worker = createWorker()
改为
const worker = createWorker({
langPath: '.',
})
或许可以改成这样,然后在 README 里面说明一下。
如果可以的话,我去开一个 PR。
...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)
Since OCR is no longer needed anymore, tesseract.js
should be remove from package.json
.
我注意到, 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
tessedit_char_whitelist
在tesseract v4下是无效选项,需要使用v3。worker.initialize("eng", OEM.TESSERACT_ONLY)
#203PSM.SINGLE_LINE
虽然不会出现换行,但是仍然会偶有识别出空格的情况。这种情况要处理一下。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",
});
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.