fewieden / MMM-soccer

European Soccer Standings Module for MagicMirror²
MIT License
31 stars 24 forks source link

Update for v2 API? #17

Closed SeLLeRoNe closed 5 years ago

SeLLeRoNe commented 5 years ago

Hi there, my understanding is that this Module use the v1 API Version from football-data.org

As far as I can see on their website they have release the v2 API Version and the data will no longer be udpated in the v1 one.

Would be possible to update the module to be compatible with the v2? For what I have found so far the main changes are:

In node_helper.js URL change: http://api.football-data.org/v1/competitions/${payload.league}/leagueTable Become: https://api.football-data.org/v2/competitions/${payload.league}/standings

The reponse is still JSON but the order of information changes. Registering a Free API Key will allow 10 API Calls per Minute (enough for what the Mirror itself should do), probably worth update the "refresh time" but not really mandatory, unless the module start also to be able to provide live results (which the APIs can provides, delayed for free or live under payment, https://www.football-data.org/pricing)

Thanks! :)

Best regars Andrea

fewieden commented 5 years ago

Hi Andrea, the develop branch already supports v2 since ~3 weeks. You can use it with checking out that branch git checkout develop.

SeLLeRoNe commented 5 years ago

Cheers! 👍

athanast6 commented 5 years ago

Hello, Sorry i am very new to all this API stuff. So if I want to update to v2, I must download the develop branch? How do I do this? Any help would be appreciated! thank you

fewieden commented 5 years ago

@athanast6 clone the repository, if not done yet, then use the develop branch.

cd ~/MagicMirror/modules
git clone https://github.com/fewieden/MMM-soccer.git
cd MMM-soccer
git checkout develop
npm install
athanast6 commented 5 years ago

Thanks so much! Working now