Giter Site home page Giter Site logo

fortnitetracker-stats's People

Contributors

clvlabs avatar gescudero avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

fortnitetracker-stats's Issues

Group api info in config file

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)

Save profile data

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

Añadir más estadisticas a clase sesion

Habría que añadir las siguientes estadísticas:

  • best match
  • total_wins
  • total_tops (hay que tener en cuenta que sólo sume 1 por partida)
  • last_trn_rating
  • trn_rating_diff (diferencia entre el rating antes de empezar la sesion y el rating al final de la sesion)
  • Obviar partidas creativo en el computo de: kills, eskores, tops

Unify tag names in formatted strings

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",

Complete README

README.md still has a lot of TO-DO tags...

Also, an external review would be nice :)

Error in the first load of the app

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

Review `API rate limit exceeded` in APIStatsGetter

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:

  • Rename config.apiStatsGetter.requestDelay as statsUpdateDelay
  • Add config.apiStatsGetter.requestDelay (again) and use it as a delay between HTTP requests

Unify logging format - user names

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

Create profile class

We need a profile class to store the mixed data of the different sources of info

Add web interface

The project still needs a web UI to allow viewing stats and modifying config

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.