Skip to content

Commit 9f4b05e

Browse files
committed
documentation updated and test directory added to npmignore
1 parent 4274de6 commit 9f4b05e

File tree

4 files changed

+94
-13
lines changed

4 files changed

+94
-13
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
src
2+
__tests_
23
junk

DISCLAIMER.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
<h1 align="center">Disclaimer</h1>
3+
4+
<div align="center">
5+
6+
<h2>This project: unoffical F1 Api</h2>
7+
8+
<br>
9+
10+
The core aim of this project is to co-relate automation and efficiency to extract what is provided to an user on the internet. Every content available in the project is hosted by external non-affiliated sources.
11+
12+
<br>
13+
14+
<b>Any content served through this project is publicly accessible. If your site is listed in this project, the code is pretty much public. Take necessary measures to counter the exploits used to extract content in your site.</b>
15+
16+
Think of this project as your normal browser, but a bit more straight-forward and specific. While an average browser makes hundreds of requests to get everything from a site, this project goes on to make requests associated with only getting the content served by the sites.
17+
18+
<b>
19+
20+
This project is to be used at the user's own risk, based on their government and laws.
21+
22+
This project has no control on the content it is serving, using copyrighted content from the providers is not going to be accounted for by the developer. It is the user's own risk.
23+
24+
</b>
25+
26+
<br>
27+
28+
<h2>DMCA and Copyright Infrigements</h3>
29+
30+
<br>
31+
32+
<b>
33+
A browser is a tool, and the maliciousness of the tool is directly based on the user.
34+
</b>
35+
36+
37+
<b> Do not harass the maintainer. </b>
38+
39+
<h2>
40+
Contacting the maintainer
41+
</h2>
42+
<br>
43+
44+
Begin by making a GitHub issue or sending an email to katheyash@yahoo.com

README.md

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,56 @@
11
# F1 API
2-
2+
![f1](https://assets.stickpng.com/images/61fc01fe3cf0e70004222071.png)
33
The scraper scrapes this given https://www.formula1.com/
44

5-
## Functions added
5+
## Functions
6+
7+
- **getConstructorStandings**
8+
9+
Fetch Constructors standings from points table.
10+
The function takes one argument: The year from which you want to extract points table for.
11+
Default argument is the current year.
12+
13+
- **getDriverStandings**
14+
Fetch F1 driver standings from points table.
15+
The function takes one argument: The year from which you want to extract points table for.
16+
Default argument is the current year.
17+
18+
- **getDriverData**
19+
Fetch the current lineup of F1 drivers.
20+
_No arguments_
21+
22+
- **getTeamsData**
23+
Fetch the current list of F1 teams along with their information.
24+
_No arguments_
25+
26+
- **getWorldChampions**
27+
Fetch all the world champions
28+
_No arguments_
29+
30+
## Snapshots
31+
32+
If you want to have a look at the output from the given functions check [this](https://github.com/yashkathe/F1-API/tree/master/__tests__/__snapshots__).
33+
34+
## Example snippet
35+
36+
Example on how to use one the given functions.
37+
The following function will print the current lineup of F1 drivers.
38+
39+
```javascript
40+
const f1Api = require('f1-api')
641

7-
- getDriverData
8-
Fetch the current list of F1 drivers along with their information
42+
const myFunction = async () => {
43+
const driverLineup = await f1Api.getDriverData()
44+
console.log(driverLineup)
45+
}
946

10-
- getTeamsData
11-
Fetch the current list of F1 teams along with their information
47+
myFunction()
48+
```
1249

13-
- getDriverStandings
14-
Fetch F1 driver standings from points table
50+
## Usage
51+
WARNING: Abusing this library may result in an IP ban from the host website.
52+
Please use with caution and try to limit the rate and amount of your requests if you value your access to formula1.com
1553

16-
- getConstructorStandings
17-
Fetch Constructors standings from points table
54+
## Report Problems
1855

19-
- getWorldChampions
20-
Fetch all the world champions
56+
If you have any problems regarding this project, read the following [disclaimer](https://github.com/yashkathe/F1-API/blob/master/DISCLAIMER.md).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"start": "nodemon './dist/server.js'",
1111
"test": "jest"
1212
},
13-
"keywords": [],
13+
"keywords": ["F1" , "Formula1", "Formula1-data", "F1-API" , "Formula1-API"],
1414
"author": "",
1515
"license": "ISC",
1616
"devDependencies": {

0 commit comments

Comments
 (0)