clvlabs / fortnitetracker-stats Goto Github PK
View Code? Open in Web Editor NEWStats and tools for fortnitetracker.com
Stats and tools for fortnitetracker.com
The project still needs a web UI to allow viewing stats and modifying config
I have to complete documentation in https://github.com/clvLabs/fortnitetracker-stats/blob/master/docs/api.md
getDifferenceBetweenDates(match_date)
function in index.js
is dummy, I have to write it
with https://fortnite-api.com/v1/stats/br/v2?name=guillataX&image=keyboardMouse we recieve a link in the ["image"] key with the profile stats image. Will be cool to add to the main page.
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/fortnitetracker-stats/app/src/lib/task.py", line 63, in _threadhandler
self.taskLoop()
File "/fortnitetracker-stats/app/src/apiprofilesgetter.py", line 57, in taskLoop
self.getProfileFromTrn(username, trn_username, platform)
File "/fortnitetracker-stats/app/src/apiprofilesgetter.py", line 90, in getProfileFromTrn
self.stats.add_stats_from_trn_dict(username, trn_profile_actual_dict)
File "/fortnitetracker-stats/app/src/model/stats.py", line 51, in add_stats_from_trn_dict
last_match_date = datetime.strptime(trn_data["recentMatches"][0]["dateCollected"], "%Y-%m-%dT%H:%M:%S")
IndexError: list index out of range
Habría que añadir las siguientes estadísticas:
It's a good idea to save the profile data in another file like matches history. Maybe later we can use that data to create progress graphics and so.
With this change we have to move the apistatsgetter.fill_users_id()
to the mainLoop()
to avoid two request for the same data
Check fortnitepy, it looks like using it we could forget about the api layer and concentrate on stats/tools
All config fields related to fortnitetracker.com could be together in the config file.
{
"api": {
"key": "xxxxxxxxxxxxxxxx",
"baseUrl": "https://api.fortnitetracker.com/v1",
"profilePath": "profile/{platform}/{trn_username}",
"matchesPath": "profile/account/{user_id}/matches"
},
}
(to be discussed)
In order to make it easier/better to later find stuff in the logs, any action related to a user should show it in a consistent manner.
Instead of
2021/01/30 00:36:02.869 INFO [APIStatsGetter] New api stats update --------------------------------
2021/01/30 00:36:02.869 INFO [APIStatsGetter] Requesting matches for guillataX
2021/01/30 00:36:03.172 INFO [APIStatsGetter] Added 1 new matches
2021/01/30 00:36:03.174 INFO [APIStatsGetter] Requesting matches for tobalinaco
2021/01/30 00:36:03.412 INFO [APIStatsGetter] Added 2 new matches
2021/01/30 00:36:03.415 INFO [APIStatsGetter] Requesting matches for Nur93
2021/01/30 00:36:03.599 ERROR [APIStatsGetter] Can't get matches for Nur93
2021/01/30 00:36:03.599 ERROR [APIStatsGetter] Response: {'message': 'API rate limit exceeded'}
2021/01/30 00:36:03.599 ERROR [APIStatsGetter] SKIPPING Nur93
we could do
2021/01/30 00:36:02.869 INFO [APIStatsGetter] New api stats update --------------------------------
2021/01/30 00:36:02.869 INFO [APIStatsGetter] [guillataX] Requesting matches
2021/01/30 00:36:03.172 INFO [APIStatsGetter] [guillataX] Added 1 new matches
2021/01/30 00:36:03.174 INFO [APIStatsGetter] [tobalinaco] Requesting matches
2021/01/30 00:36:03.412 INFO [APIStatsGetter] [tobalinaco] Added 2 new matches
2021/01/30 00:36:03.415 INFO [APIStatsGetter] [Nur93] Requesting matches
2021/01/30 00:36:03.599 ERROR [APIStatsGetter] [Nur93] Can't get matches
2021/01/30 00:36:03.599 ERROR [APIStatsGetter] [Nur93] Response: {'message': 'API rate limit exceeded'}
2021/01/30 00:36:03.599 ERROR [APIStatsGetter] [Nur93] SKIPPING
😛
Sample run:
2021/01/30 00:36:02.869 INFO [APIStatsGetter] New api stats update --------------------------------
2021/01/30 00:36:02.869 INFO [APIStatsGetter] Requesting matches for guillataX
2021/01/30 00:36:03.172 INFO [APIStatsGetter] Added 1 new matches
2021/01/30 00:36:03.174 INFO [APIStatsGetter] Requesting matches for tobalinaco
2021/01/30 00:36:03.412 INFO [APIStatsGetter] Added 2 new matches
2021/01/30 00:36:03.415 INFO [APIStatsGetter] Requesting matches for Nur93
2021/01/30 00:36:03.599 ERROR [APIStatsGetter] Can't get matches for Nur93
2021/01/30 00:36:03.599 ERROR [APIStatsGetter] Response: {'message': 'API rate limit exceeded'}
2021/01/30 00:36:03.599 ERROR [APIStatsGetter] SKIPPING Nur93
As stated in fortnite tracker api documentation:
1 request per 2 seconds
Suggested change:
config.apiStatsGetter.requestDelay
as statsUpdateDelay
config.apiStatsGetter.requestDelay
(again) and use it as a delay between HTTP requestsCut sessions if change game_mode OR interval > gap
README.md still has a lot of TO-DO
tags...
Also, an external review would be nice :)
Try to use the original api field names in formatted strings.
"trackerUrl": "https://fortnitetracker.com/profile/all/{user}/matches",
should be
"trackerUrl": "https://fortnitetracker.com/profile/all/{trn_username}/matches",
I want to have the chance to navigate between past sessions in the matches table, this buttons must be in each table created for each user. Something like past/next buttons << >>
We need a profile class to store the mixed data of the different sources of info
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.