hristonev / sportmonks-client-bundle Goto Github PK
View Code? Open in Web Editor NEWEasily talk to an SportMonks API in PHP
License: MIT License
Easily talk to an SportMonks API in PHP
License: MIT License
Please implement filters. This project is not a representation of the sportmonks api as you mentioned in another issue... You are supposed to be able to filter fixtures by league for example, just like the sportmonks api allows you to...
Hello,
I am using Fixtures endpoint with Includes localTeam, visitorTeam, and Odds,
How can I get a specific record for a bookmaker? I have asked the sportmonks support and they have suggested adding &bookmaker=2
in the request parameter.
Please help me to get this done in the query parameter.
Right Now I have done this.
` $scheme = SCHEME;
$hostname = HOSTNAME;
$subDomain = SUBDOMAIN;
$port = PORT;
$token = TOKEN;
//Instantiate our class
$client = new SportMonksAPI();
//Set auth.
$client->setAuth( Auth::BASIC, [
'token' => $token,
] );
$date_object = new DateTime( $date );
$matches = $client->fixtures()->date()->day(
$date_object,
[
'query' => [
'include' => 'localTeam,visitorTeam,odds',
'leagues' => $league_id,
'bookmakers' => 2
],
] );
$matches = PluginCore::sort_array_of_object( $matches );
return $matches;`
I am doing this call inside a foreach loop to return each competition matches. This call works just fine if it's outside a foreach loop. When in foreach I only get the first competition array but then the array is not reseted! it keeps returning the same results for the first loop, I tried to unset the variables but that does not seem to work. any idea?
foreach($comps as $comp){
$comp_api = $comp->comp_id;
$from_date = new datetime($start_date);
$to_date = new datetime($end_date);
$matches_setup = ['query' => ['leagues' => $comp_id]];
#loop matches
$matches = array();
do {
$matches = array_merge($matches, $api->fixtures()->between()->period($from_date, $to_date, null, $matches_setup));
} while ($monk_framework->fixtures()->nextPage($matches_setup));
$results = $matches;
/*
* part where data is inserted to db
*/
}
Is there something wrong with how am doing it?
Hi,
I get this error Notice: Undefined property: SportMonks\API\HTTPClient::$teams in ... , when i try to load teams by season.
Hi,
I was trying to set the timezone to something different but couldnt find where todo this for the API. Any way i could set this within initializing of the API?
How can I use filters?
For example: I want to find seasons with name = '2017/2018'.
Is posible?
I have downloaded the API.
But, I'm not able to create how-to call and configure this API.
I don't know how can I use FunctionalTest.php.
So please guide me for the same. Like what is the API call and request URL.
I was wondering if there was a reason that the retrieved data is held as a stdClass Object rather than as an array?
Obviously the simplest solution is to manipulate it is json/encode/decode to return an array.
$array = json_decode(json_encode($object), True);
However, I wondered if there was a particular reason for this form that I don't yet understand, and if not if there could be a way to flag the code to return an array rather than a stdClass Object?
Any chance you could add the coaches endpoint, please?
Those API endpoints DO implement pagination as per https://www.sportmonks.com/products/soccer/docs/2.0/fixtures/18 docs. This applies to:
However when you try to paginate it you get:
Fatal error: Uncaught Exception: Method nextPage does not exist SportMonks\API\Resources\FixturesBetween in path_removed/vendor/hristonev/sportmonks-client-bundle/src/SportMonks/API/Traits/Utility/InitTrait.php:37
Hi, thanks for your good project.
This helps me very much and saves me time.
But I have a problem with this project, It was H2H Pagination.
The API returns h2h results with pagination info. So I need to navigate all h2h results.
But this project doesn't support H2H Pagination.
So I made a small change to this project.
I hope @hristonev to make changes, please.
What I did is very simple.
In Head2Head.php file, I added, "use NextPage;
".
After that, added "$params = array_merge($params, self::$param);"
before "return statement of get method".
That's all.
Thanks. Best regards.
While trying to include parameters such as league_id in the fixture by date along with include, it doesn't give requested data.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.