Giter VIP home page Giter VIP logo

just-scored's Introduction

Hi.

My name is Paweł, and I'm a developer that uses Python to create stuff.

Some of the projects I created:

  • pymonzo - Modern Python API client for Monzo public API.
  • monz - Simple CLI for your Monzo account.
  • fakester - Rickroll your boss while preserving the element of surprise.

Some of the projects I contributed to:
pytest, tox, celery, errbot, mattermost, django-polymorphic, django-organizations, django-reversion, django-kronos

Some other things:

just-scored's People

Contributors

pawelad avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

just-scored's Issues

Properly process own goals

Properly process own goals, which appear under player's team events:

{
  "venue": "Moscow",
  "location": "Spartak Stadium",
  "status": "completed",
  "time": "full-time",
  "fifa_id": "300331545",
  "home_team_statistics": {
    "attempts_on_goal": 10,
    "on_target": 4,
    "off_target": 5,
    "blocked": 1,
    "woodwork": 0,
    "corners": 3,
    "offsides": 3,
    "ball_possession": 57,
    "pass_accuracy": 88,
    "num_passes": 552,
    "passes_completed": 483,
    "distance_covered": 110,
    "balls_recovered": 43,
    "tackles": 11,
    "clearances": 23,
    "yellow_cards": 1,
    "red_cards": 0,
    "fouls_committed": 8,
    "country": "Poland"
  },
  "away_team_statistics": {
    "attempts_on_goal": 8,
    "on_target": 2,
    "off_target": 4,
    "blocked": 2,
    "woodwork": 0,
    "corners": 3,
    "offsides": 3,
    "ball_possession": 43,
    "pass_accuracy": 81,
    "num_passes": 328,
    "passes_completed": 266,
    "distance_covered": 107,
    "balls_recovered": 48,
    "tackles": 9,
    "clearances": 38,
    "yellow_cards": 2,
    "red_cards": 0,
    "fouls_committed": 15,
    "country": "Senegal"
  },
  "home_team_country": "Poland",
  "away_team_country": "Senegal",
  "datetime": "2018-06-19T15:00:00Z",
  "winner": "Senegal",
  "winner_code": "SEN",
  "home_team": {
    "country": "Poland",
    "code": "POL",
    "goals": 1
  },
  "away_team": {
    "country": "Senegal",
    "code": "SEN",
    "goals": 2
  },
  "home_team_events": [
    {
      "id": 222,
      "type_of_event": "yellow-card",
      "player": "Grzegorz KRYCHOWIAK",
      "time": "12'"
    },
    {
      "id": 224,
      "type_of_event": "goal-own",
      "player": "Thiago CIONEK",
      "time": "37'"
    },
    {
      "id": 223,
      "type_of_event": "goal-own",
      "player": "Thiago CIONEK",
      "time": "38'"
    },
    {
      "id": 225,
      "type_of_event": "substitution-out",
      "player": "Jakub BLASZCZYKOWSKI",
      "time": "46'"
    },
    {
      "id": 226,
      "type_of_event": "substitution-in",
      "player": "Jan BEDNAREK",
      "time": "46'"
    },
    {
      "id": 231,
      "type_of_event": "substitution-out",
      "player": "Arkadiusz MILIK",
      "time": "73'"
    },
    {
      "id": 232,
      "type_of_event": "substitution-in",
      "player": "Dawid KOWNACKI",
      "time": "73'"
    },
    {
      "id": 237,
      "type_of_event": "substitution-out",
      "player": "Lukasz PISZCZEK",
      "time": "83'"
    },
    {
      "id": 238,
      "type_of_event": "substitution-in",
      "player": "Bartosz BERESZYNSKI",
      "time": "83'"
    },
    {
      "id": 236,
      "type_of_event": "goal",
      "player": "Grzegorz KRYCHOWIAK",
      "time": "86'"
    }
  ],
  "away_team_events": [
    {
      "id": 227,
      "type_of_event": "yellow-card",
      "player": "Salif SANE",
      "time": "49'"
    },
    {
      "id": 228,
      "type_of_event": "goal",
      "player": "Mbaye NIANG",
      "time": "60'"
    },
    {
      "id": 229,
      "type_of_event": "substitution-out",
      "player": "Mame DIOUF",
      "time": "62'"
    },
    {
      "id": 230,
      "type_of_event": "substitution-in",
      "player": "Cheikh NDOYE",
      "time": "62'"
    },
    {
      "id": 233,
      "type_of_event": "yellow-card",
      "player": "Idrissa Gana GUEYE",
      "time": "72'"
    },
    {
      "id": 234,
      "type_of_event": "substitution-out",
      "player": "Mbaye NIANG",
      "time": "75'"
    },
    {
      "id": 235,
      "type_of_event": "substitution-in",
      "player": "Moussa KONATE",
      "time": "75'"
    },
    {
      "id": 239,
      "type_of_event": "substitution-out",
      "player": "Alfred NDIAYE",
      "time": "87'"
    },
    {
      "id": 240,
      "type_of_event": "substitution-in",
      "player": "Cheikhou KOUYATE",
      "time": "87'"
    }
  ],
  "last_event_update_at": "2018-06-21T02:18:31Z",
  "last_score_update_at": "2018-06-19T16:53:34Z"
}

Don't send the notification if the goal wasn't scored in the last 5 minutes

Not sure what's the best way to do that, but we should only be sending the notification if the goal happened recently.

One of the possible scenarios is the API not being updated for 30 minutes because of maintenance / outage, and then updating it all at once - we would send notifications for all scored goals, even if they happened in the first/second/tenth minute. Ideally, we would send it only if it happened after the 25th minute.

Penalties have different `type_of_event`

Penalties have goal-penalty type of event and are currently not added to the DB.

Example:

    "away_team_events": [
      {
        "id": 357,
        "type_of_event": "goal-penalty",
        "player": "Mile JEDINAK",
        "time": "38'"
      },
      {
        "id": 362,
        "type_of_event": "substitution-out",
        "player": "Robbie KRUSE",
        "time": "68'"
      },
      {
        "id": 363,
        "type_of_event": "substitution-in",
        "player": "Daniel ARZANI",
        "time": "68'"
      }
    ]

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.