Cheers Dallas
Football Scores, In-Play Stats & Momentum via script, using an API. Code and example BAF
-
- Posts: 1088
- Joined: Fri Nov 20, 2015 9:38 am
aha - you switched it round - nice one... will have a think about it..sniffer66 wrote: ↑Thu Jan 06, 2022 1:04 pm
Sionas, I think I've gone a long way, if not 100% of the way to solving the name matching issue.
Not sure what your coding is like but hopefully you can follow, using the SofaScore code I've already posted as an example. I got the idea from another post earlier today
The issue is that it's very hard to do any pattern based matching in Guardian, but easier to do in code. So, I had the idea to extract the current market name using an "Export data from CSV" rule, every x seconds. That gives you the current market name alongside any set SV's
By reading the exported CSV into my script as an array, or array of arrays, I can then do some decent string comparison checking against the market name string and pass SV values for that exact market name back into Guardian using my existing "Import data from CSV" rule
The beauty of doing it this way is you are passing back the EXACT market\selection name that BF is using, plus you only need to query external stats\data for markets your BAF is applied to, all other scraped\queried data can be ignored as it's not needed
Hope that makes sense
Regards...
-
- Posts: 1088
- Joined: Fri Nov 20, 2015 9:38 am
Would you believe it - Leic vs Watford today, two Shown a Card markets atm....
"Shown a Card" & Shown a card?"
pffft...
"Shown a Card" & Shown a card?"
pffft...
Right now the script finds a wrong value for the home score in the game Konyaspor - Sivasspor.
It finds 1 homegoal throgh the API, while the correct one (and also the one showing on sofascore.com) is 0.
This seems to be an error in the sofascore API, or can it be something I have done wrong?
In the first case, anyone knows the error rate?
It finds 1 homegoal throgh the API, while the correct one (and also the one showing on sofascore.com) is 0.
This seems to be an error in the sofascore API, or can it be something I have done wrong?
In the first case, anyone knows the error rate?
There was an U19 game with the same teams running earlier so it may have picked up the matching names. It's not 100% foolproof due to the naming issue we've discussed previouslyasaele wrote: ↑Sun Jan 09, 2022 11:11 amRight now the script finds a wrong value for the home score in the game Konyaspor - Sivasspor.
It finds 1 homegoal throgh the API, while the correct one (and also the one showing on sofascore.com) is 0.
This seems to be an error in the sofascore API, or can it be something I have done wrong?
In the first case, anyone knows the error rate?
However, if you see my more recent posts on the thread I've come up with a much better way of extracting the names used in the BF market, using the csv export rule. Just about to take my PC down due to building work over the next few days, but will try and get a script update out when I can
Unsure if this will amount to anything but a rework of the script now logs out all the available stats and momentum data every time a goal is scored. Unfortunately the historical API data doesnt capture goal times so forced to capture in real time.
A few weeks capturing though and might have aggregated data worth triggering an entry for...
A few weeks capturing though and might have aggregated data worth triggering an entry for...
You do not have the required permissions to view the files attached to this post.
-
- Posts: 165
- Joined: Thu May 09, 2013 5:57 pm
Absolutely brilliant job Stu. Collect that data and it will present you with worthy trades.sniffer66 wrote: ↑Wed Jan 12, 2022 3:50 pmUnsure if this will amount to anything but a rework of the script now logs out all the available stats and momentum data every time a goal is scored. Unfortunately the historical API data doesnt capture goal times so forced to capture in real time.
A few weeks capturing though and might have aggregated data worth triggering an entry for...
Capture.JPG
Interesting. Is this output from betangel (a new version of the rules file), or are you doing this directly in (a new version) of the script?
Anyhow, would be very interested in a copy
Once again this is great stuff!
Wondering if the inplay time is also possible to extract from the Sofascore API? In that case it would be very helpful, and solve the problem of having the correct inplay time after halftime. It is available right next to the momentum graph visually so probably accessible through the API as well?
Another nice addition would be red (and yellow) cards per team if available?
Is there a place you can find the available fields in the API? In that case I could check and change the script myself
Bear with me mate. As per your pm, I'm just crash testing the feedback loop from the csv output before I post it up. Can definitely do cards and times. Once I know it has no errors I'll put it up hereasaele wrote: ↑Thu Feb 03, 2022 10:18 amOnce again this is great stuff!
Wondering if the inplay time is also possible to extract from the Sofascore API? In that case it would be very helpful, and solve the problem of having the correct inplay time after halftime. It is available right next to the momentum graph visually so probably accessible through the API as well?
Another nice addition would be red (and yellow) cards per team if available?
Is there a place you can find the available fields in the API? In that case I could check and change the script myself
I tried this today. I trimmed out all the SV's except Set Current Home Score and Set Current Away Score and had them posting to the log every 60 seconds. Sadly, it only recognised one goal in one match all the other matches remained at Home Goals = 0 Away Goals = 0. In the match where it recognised the one goal it didn't recognise the subsequent goals.
When I look in the .csv file all the goals appear to be there but they weren't picked up by the .baf automation file.
When I look in the .csv file all the goals appear to be there but they weren't picked up by the .baf automation file.
- MemphisFlash
- Posts: 2222
- Joined: Fri May 16, 2014 10:12 pm
- Location: Leicester
works a treat.
You do not have the required permissions to view the files attached to this post.
- MemphisFlash
- Posts: 2222
- Joined: Fri May 16, 2014 10:12 pm
- Location: Leicester
You do not have the required permissions to view the files attached to this post.