inevs / fpe-homepage

2 stars 0 forks source link

Livescore einbinden #36

Closed inevs closed 6 years ago

inevs commented 6 years ago

Es wäre cool wenn wir noch irgendwie den Livescore mit reinbekommen.

marschwar commented 6 years ago

Vermutlich allerdings nicht als iframe sondern eher als plugin. Dann könnte man die Daten drupal seitig noch cachen.

https://footballscores.herokuapp.com/games/565.json

{
  "home_team": "Elmshorn Fighting Pirates",
  "away_team": "Berlin Bears",
  "user": "Louisa Froh",
  "location": "Krückau Stadion",
  "game_day": "2017-09-17",
  "game_time": "15:00",
  "period": "Final",
  "final": true,
  "started": true,
  "updated_at": {
    "time": "2017-09-17T17:56:50.194+02:00",
    "words": "5 months"
  },
  "score": {
    "home": {
      "total": 45,
      "periods": [
        14,
        10,
        14,
        7
      ]
    },
    "away": {
      "total": 28,
      "periods": [
        3,
        0,
        7,
        18
      ]
    }
  },
  "notes": [
    {
      "created_at": "17:56",
      "text": "Ende"
    },
    {
      "created_at": "17:56",
      "text": "Ein letzter TD für Berlin - Zeit ist um aber extra Punkt wird noch gespielt "
    },
    {
      "created_at": "17:55",
      "text": "Incomplete pass - 4 sek noch und der 2 Versuch um 5 yards zu gehen "
    },
    {
      "created_at": "17:54",
      "text": "8 sek noch"
    },
    {
      "created_at": "17:53",
      "text": " Incomplete pass - 16 sek noch"
    },
    {
      "created_at": "17:52",
      "text": "9 yards raumgewinn"
    },
    {
      "created_at": "17:51",
      "text": "Auszeit Berlin "
    },
    {
      "created_at": "17:50",
      "text": "30 sek noch auf der Uhr "
    },
    {
      "created_at": "17:50",
      "text": "Zeit läuft runter "
    },
    {
      "created_at": "17:50",
      "text": "1. Versuch an der 39 der Pirates "
    },
    {
      "created_at": "17:48",
      "text": "1 Minute 20 noch auf der Uhr "
    },
    {
      "created_at": "17:47",
      "text": " Firstdown an der eigenen 39"
    },
    {
      "created_at": "17:45",
      "text": "Berlin returnt bis an die eigene 25 "
    },
    {
      "created_at": "17:44",
      "text": "2:18 Minuten noch "
    },
    {
      "created_at": "17:43",
      "text": "Pat ist gut"
    },
    {
      "created_at": "17:42",
      "text": "Nr 22"
    },
    {
      "created_at": "17:42",
      "text": "Unsportliches Verhalten Berlin - Spieler würde disqualifiziert "
    },
    {
      "created_at": "17:41",
      "text": "run zum TD - Flaggen aber nach dem angezeigten  TD"
    },
    {
      "created_at": "17:40",
      "text": "Complete pass auf 16 und firstdown + raumstrafe für die Defense also startet die offense an der 10 der Berlin Bears "
    },
    {
      "created_at": "17:37",
      "text": "Warning - Batterie fast leer."
    },
    {
      "created_at": "17:37",
      "text": "Return team der pirates auf dem Feld "
    },
    {
      "created_at": "17:35",
      "text": "Berlin startet an der 10 von dem Pirates - TD "
    },
    {
      "created_at": "17:34",
      "text": "Interception von Berlin aber Flaggen auf dem Feld aber erst nach der interception "
    },
    {
      "created_at": "17:31",
      "text": "Complete pass und firstdown an der 47"
    },
    {
      "created_at": "17:30",
      "text": "Elmshorn startet an der eigenen 37"
    }
  ]
}
inevs commented 6 years ago

das klingt nach Spaß :-)

inevs commented 6 years ago

see Branch live_score

marschwar commented 6 years ago

https://www.drupal.org/docs/8/creating-custom-modules https://www.chapterthree.com/blog/cache-api-drupal

inevs commented 6 years ago

Idee: Button zum Aktualisieren, bei Button-Click per Ajax den Content neu laden

https://api.drupal.org/api/drupal/core%21core.api.php/group/ajax/8.4.x

Vielleicht gibt es auch die Möglichkeit zeitgesteuert zu aktualisieren?

inevs commented 6 years ago

Neue Idee: Daten per Javascript abrufen und dann einbinden