Recommend this page to a friend! |
Download |
Info | Example | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 238 | All time: 8,054 This week: 206 |
Version | License | PHP version | Categories | |||
coronavirusdatabase 1.0.0 | GNU General Publi... | 5 | PHP 5, Statistics, Web services, Biology |
<?php |
This package provides an API to lookup information about Corona Virus.
It can provides API entries to perform queries on a database with figures about the current status of the Corona Virus epidemic around the world. Currently it can:
A repository for analyzing references and database of gisanddata.maps.arcgis.com
website for Corona Virus.
Website: https://gisanddata.maps.arcgis.com/apps/opsdashboard/index.html#/bda7594740fd40299423467b48e9ecf6
Downloadable database: GitHub: Here.
There is a csv
files for every day. e.g: https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data
But main site has not get data from that.
By checking main website, I did check all requests and links:
Finaly I found this:
https://services1.arcgis.com/0MSEUqKaxRlEPj5g/arcgis/rest/services/ncov_cases/FeatureServer/2/query?f=json&where=Confirmed%20%3E%200&returnGeometry=false&spatialRel=esriSpatialRelIntersects&outFields=*&orderByFields=Confirmed%20desc&resultOffset=0&resultRecordCount=1000&cacheHint=true
But you can see all requests as HAR format at here.
This project is a web service that allows you to create different accesses.
And later use this web service in different applications and sites. e.g: You may even sell a subscription to this web service.
All request of this web-service will need a token for Auth and access to methods.
There is a table for tokens, called token
.
So you can create one token or more.
In READMD.me
file, I explain how can use from web service.
So others can using this key to access to this web-service.
You will need to execute $ php _update.php update
in src/ directory to insert and updates data into your database, then you can use from API methods.
(You should pass token value in Headers)
Remember it's a API service, if are you looking for a script to display directly list of corona cases, you can check below repositories:
https://github.com/BaseMax/api-webservice-COVID-19/
https://github.com/BaseMax/CoronaVirusOutbreakAPI/
Create a token in database:
In additation of my message: If you want to use this API webservice, And want to easily see response of methods.
You can use a plugins in your browser. such as: https://chrome.google.com/webstore/detail/modheader/idgpnmonknjnojddfkpgkljpfnnfcklj?hl=en
You had to add Token
header with a value.
All request need token
value in header, You can create token
in token table.
GET: http://localhost/CoronaVirusDatabase/src/?method=list
POST: http://localhost/CoronaVirusDatabase/ with method=list
data
{
status: "success",
message: "",
lastUpdate: "2020-02-27 18:05:06",
result: [
{
id: 1,
name: "china",
totalCase: 78514,
newCase: 450,
totalDeath: 2747,
newDeath: 32,
totalRecovered: 32954,
seriousUser: 8346,
datetime: "2020-02-27 18:05:03"
},
...
]
}
GET: http://localhost/CoronaVirusDatabase/src/?method=list&sort=totalCase&type=desc
POST: http://localhost/CoronaVirusDatabase/ with method=list&sort=totalCase&type=desc
data
GET: http://localhost/CoronaVirusDatabase/src/?method=list&sort=totalCase&type=asc
POST: http://localhost/CoronaVirusDatabase/ with method=list&sort=totalCase&type=asc
data
GET: http://localhost/CoronaVirusDatabase/src/?method=search&query=ir
POST: http://localhost/CoronaVirusDatabase/ with method=search&query=ir
{
status: "success",
message: "",
result: [
{
id: 5,
name: "iran",
totalCase: 245,
newCase: 106,
totalDeath: 26,
newDeath: 7,
totalRecovered: 25,
seriousUser: 0,
datetime: "2020-02-27 16:05:56"
},
{
id: 24,
name: "iraq",
totalCase: 6,
newCase: 1,
totalDeath: 0,
newDeath: 0,
totalRecovered: 0,
seriousUser: 0,
datetime: "2020-02-27 16:05:59"
}
]
}
GET: http://localhost/CoronaVirusDatabase/src/?method=search&query=ir&sort=totalCase&type=asc
POST: http://localhost/CoronaVirusDatabase/ with method=search&query=ir&sort=totalCase&type=asc
data
GET: http://localhost/CoronaVirusDatabase/src/?method=total
POST: http://localhost/CoronaVirusDatabase/ with method=total
{
status: "success",
message: "",
result: {
all: "163492",
died: "5588"
}
}
> Note: corona.sql is database structure with empty table, you will use it to setup this project. But output.sql is a database output with current corona data.
Run $ php _update.php update
every time you want to update your database rows.
It will automaticly update and change data, if they are new or changed!
Crontab command: /2 * php _update.php >/dev/null 2>&1
Current time is: 2020-02-26 7:29:00 PM UTC
This cron job will be run at: (5 times displayed and more...)
A tiny and small program to crawler and analyze outbreak of COVID-19 in world and every country using PHP.
The novel coronavirus COVID-19 is affecting 45 countries and territories around the world and 1 international conveyance (the "Diamond Princess" cruise ship harbored in Yokohama, Japan).
The bulk of China's new cases and deaths are reported after 22:00 GMT (5:00 PM ET) for Hubei (lately with delays of up to 2 hours), and after 00:00 GMT (7:00 PM ET) for the rest of China (lately with delays of up to 9 hours).
My nickname is Max, Programming language developer, Full-stack programmer. I love computer scientists, researchers, and compilers. (Max Base)
A team includes some programmer, developer, designer, researcher(s) especially Max Base.
Files (12) |
File | Role | Description | ||
---|---|---|---|---|
src (5 files) | ||||
corona.sql | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
output.sql | Data | Auxiliary data | ||
README.md | Doc. | Documentation | ||
response.json | Data | Auxiliary data | ||
screen1.jpg | Data | How create a token in database? | ||
screen2.jpg | Data | How to directly see response of methods, using a plugin in chrome. |
Files (12) | / | src |
File | Role | Description |
---|---|---|
index.php | Example | Example script |
_core.php | Example | Example script |
_netphp.php | Aux. | Auxiliary script |
_phpedb.php | Class | Class source |
_update.php | Example | Example script |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
coronavirusdatabase-2020-03-29.zip 107KB | |
coronavirusdatabase-2020-03-29.tar.gz 108KB | |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.