Chrome extensions 3-Thống kê tình hình dịch virus Corona – nCoV
Extension Thống kê tình hình dịch virus Corona – nCoV
Link demo
http://demo.gacoder.info/corona/popup.html
Nguồn thống kê:vnexpress.net và https://gisanddata.maps.arcgis.com/apps/opsdashboard/index.html#/bda7594740fd40299423467b48e9ecf6
1.Phía server:
1.1 Sử dụng nodejs làm webservice
Setup nodejs:
Tạo file package.json:
{ "name": "get_corona", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "axios": "^0.19.0", "cheerio": "^1.0.0-rc.3", "express": "^4.17.1", "moment": "^2.24.0" } }
Setup package:
npm init
1.2 Get data từ service của vnexpress.net
2.Chrome extension:
Tạo file manifest.json
{ "manifest_version": 2, "name": "Corona", "description": "Xem kết quả corona", "version": "1.0", "icons": { "128": "icon128.png", "48": "icon48.png", "16": "icon16.png" }, "browser_action": { "default_icon": "icon16.png", "default_popup": "popup.html" }, "permissions": [ "storage" ] }
File popup.html view here
File popup.js
Url service default:http://demo.gacoder.info/demo4/corona
Link code chrome extension in here
Link code server in here