I wanted an easy way to get my friends ratings in PUBG. This command-line program uses https://pubg.op.gg/ as a means of obtaining a person's stats.
In order to obtain a person's stats we require an id
to access pubg.op.gg api. However,
I couldn't be bothered to go through and find all of my friend's id
's and decided to make a webscraper instead.
Heres how the program functions:
- Grab pubg usernames from
input.json
. - Grab the cached
username to id
mapping fromid-mapping.json
if it exists. - Start aggregating data by iterating through username array:
- If the username doesn't have an
id mapping
then webscrape from pubg.op.gg by using phantomJS. - If the username DOES have an
id mapping
then call pubg.op.gg's api directly (this saves a lot of time)
- If the username doesn't have an
- Update the cached data so future runs are quicker.
- Install node.
- Clone the repo
npm install
- Add pubg character names to
input.json
. node phantom-server.js
- Open output.json