Closed jonsnowpt closed 2 years ago
@migbash
League ID is not populated.
Working on #7
to finalize the backend.
@jonsnowpt completed! Deployed on:
CRON | Frequency |
---|---|
[backend] [dev] historic wp links |
1 hour |
[backend] [dev] historic media links |
30 min |
[backend] [firebase] 5s livescore now update |
1 min (*) |
(*) 5 sec. interval not possible in CRON
@migbash
Waiting for real-time update outside of cron.
We need to populate all information related to the fixtures, including live scores and fixtures. Also, we need to add the WP links associated with each fixture.
Steps:
historic_fixtures
by date range from 2004 to the end of the current year.Get information from the provider and populate the Hasura DB.
Provider endpoint:
https://soccer.sportmonks.com/api/v2.0/fixtures/between/:STARTDATE/:ENDATE?include=localTeam,visitorTeam,substitutions,goals,cards,other events,corners,lineup,bench,sidelined,comments,tvstations,round,stage,referee,venue,localCoach,visitorCoach,group,trends,firstAssistant,secondAssistant,fourthOfficial,stats,shootout,league,stats,probability,valuebet,news
Hasura endpoint Dev:
historic_fixtures_dev
Hasura endpoint Prod:
historic_fixtures
Columns:
Mock Data:
https://cloud.hasura.io/project/1b086d12-8b64-462e-b7cc-f3f5e2c1702d/console/data/betarena_prod/schema/public/tables/historic_fixtures/browse
Update frequency:
Dev = Manual Once Prod = Manual Once
historic_fixtures
we will use a specific data range dailly that provides fixtures for the next 2 weeks and another one that will get fixtures for the next 12 months that will run every 2 weeksGet information from the provider and populate the Hasura DB.
Range from today for the next 2 weeks:
Provider endpoint:
https://soccer.sportmonks.com/api/v2.0/fixtures/between/:STARTDATE/:ENDATE?include=localTeam,visitorTeam,substitutions,goals,cards,other events,corners,lineup,bench,sidelined,comments,tvstations,round,stage,referee,venue,localCoach,visitorCoach,group,trends,firstAssistant,secondAssistant,fourthOfficial,stats,shootout,league,stats,probability,valuebet,news
Dev = 24 hours Prod = 24 hours
Range from today for the next 12 months:
Provider endpoint:
https://soccer.sportmonks.com/api/v2.0/fixtures/between/:STARTDATE/:ENDATE?include=localTeam,visitorTeam,substitutions,goals,cards,other events,corners,lineup,bench,sidelined,comments,tvstations,round,stage,referee,venue,localCoach,visitorCoach,group,trends,firstAssistant,secondAssistant,fourthOfficial,stats,shootout,league,stats,probability,valuebet,news
Dev = Every 2 weeks Prod = Every 2 weeks
historic_fixtures
we will use a specific endpoint that provides only the latest updated fixtures.This endpoint will bring only the fixtures that have been updated in the last 2 hours.
Provider endpoint:
https://soccer.sportmonks.com/api/v2.0/fixtures/updates?include=localTeam,visitorTeam,substitutions,goals,cards,other events,corners,lineup,bench,sidelined,comments,tvstations,round,stage,referee,venue,localCoach,visitorCoach,group,trends,firstAssistant,secondAssistant,fourthOfficial,stats,shootout,league,stats,probability,valuebet
Dev = Hourly Prod = Hourly
Get information from the provider and populate the Firebase DB.
Provider endpoint:
https://soccer.sportmonks.com/api/v2.0/livescores/now?include=localTeam,visitorTeam,substitutions,goals,cards,other,events,corners,lineup,bench,sidelined,comments,tvstations,,round,stage,referee,venue,localCoach,visitorCoach,group,trends,stats,probability,valuebet
Firebase endpoint:
livescores_now
firebase_livescore_now_structure.json.zip
Frequency: Every 5s
Get information from the WP-API and populate the Hasura DB.
Wordpress API v2.postman_collection.json.zip
Access the WP API using the data range:
WP-API
Change the categories as needed to retrieve data, and use the latest 24 hours time range. Use the categories to identify the lang on Hasura (betarena_content) =
categories_lang
Keys:
International:
https://www.betarena.com/wp-json/wp/v2/posts?orderby=date&order=desc&before=2022-04-07T23:59:00&after=2022-04-01T13:00:00&categories=68974
BR and PT:
https://apostas.betarena.com/wp-json/wp/v2/posts?orderby=date&order=desc&before=2022-04-07T23:59:00&after=2022-04-01T13:00:00&categories=94220
If ID matches with the fixture ID add the icon and respective link to the fixture:
Example:
"link": "https://www.betarena.com/seattle-sounders-vs-new-york-city-concacaf-champions-league-prediction-and-betting-tips-on-06-04-2022/",
Hasura endpoint Dev:
historic_fixtures_dev
Hasura endpoint Prod:
historic_fixtures
Columns:
Mock Data:
https://cloud.hasura.io/project/1b086d12-8b64-462e-b7cc-f3f5e2c1702d/console/data/betarena_prod/schema/public/tables/historic_fixtures/browse
Update frequency:
Dev = 24 hours Prod = Hourly
Get information from the WP-API and populate the Hasura DB.
Access the WP API using the data range:
WP-API
Change the categories as needed to retrieve data, and use the latest 24 hours time range. Use the categories to identify the lang on Hasura (betarena_content) =
categories_lang
Keys:
International:
https://www.betarena.com/wp-json/wp/v2/posts?orderby=date&order=desc&before=2022-04-07T23:59:00&after=2022-04-01T13:00:00&categories=70708
BR and PT:
https://apostas.betarena.com/wp-json/wp/v2/posts?orderby=date&order=desc&before=2022-04-07T23:59:00&after=2022-04-01T13:00:00&categories=71024
If ID matches with the fixture ID add the link to the fixture:
Example:
""link": "https://www.betarena.com/vasas-vs-szeged-2011-livescore-preview-3/",
Hasura endpoint Dev:
historic_fixtures_dev
Hasura endpoint Prod:
historic_fixtures
Columns:
Mock Data:
https://cloud.hasura.io/project/1b086d12-8b64-462e-b7cc-f3f5e2c1702d/console/data/betarena_prod/schema/public/tables/historic_fixtures/browse
Update frequency:
Dev = 24 hours Prod = Hourly
Get information from the Firebase endpoint.
*Firebase
https://console.firebase.google.com/u/0/project/betarena-ios/database/betarena-rv-6b382/data/~2Fmedia_higlights_sources
Use team names match to verify if there is media available and add it to: media_highlights (true / false) (use team names match minimum 60%)
If Team Names matches with at least 60%, add the media icon and link
Example:
betarena-rv-6b382-3938974-export.json.zip
Columns:
Mock Data:
https://cloud.hasura.io/project/1b086d12-8b64-462e-b7cc-f3f5e2c1702d/console/data/betarena_prod/schema/public/tables/historic_fixtures/browse
Update frequency:
Dev = 24 hours Prod = 30 min