├── manifest.json ├── README.md ├── script.js └── index.html /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Covid-19 Stats UK", 3 | "version": "1.0.0", 4 | "description": "latest covid data of UK", 5 | "manifest_version": 3, 6 | "author": "Sampurna Chapagain", 7 | "action":{ 8 | "default_popup": "index.html", 9 | "default_title": "Latest Covid Report" 10 | } 11 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Chrome Extension to show the latest data on covid of UK 2 | ======= 3 |  4 | 5 | # Tools used # 6 | * HTML, CSS and JavaScript 7 | * [Bootstrap 5](https://getbootstrap.com/docs/5.0/getting-started/introduction/) 8 | 9 | 10 | Author [Sampurna Chapagain](https://twitter.com/saam_codes) 11 | -------------------------------------------------------------------------------- /script.js: -------------------------------------------------------------------------------- 1 | async function fetchData() { 2 | const res = await fetch ("https://api.coronavirus.data.gov.uk/v1/data"); 3 | const record = await res.json(); 4 | console.log(record); 5 | document.getElementById("date").innerHTML=record.data[0].date; 6 | document.getElementById("areaName").innerHTML=record.data[0].areaName; 7 | document.getElementById("latestBy").innerHTML=record.data[0].latestBy; 8 | document.getElementById("deathNew").innerHTML=record.data[0].deathNew; 9 | } 10 | fetchData(); -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 || Date | 15 |Country | 16 |Confirmed | 17 |Deaths | 18 |
|---|---|---|---|
| 23 | | 24 | | 25 | | 26 | |