Code Monkey home page Code Monkey logo

sportmonks-client-bundle's People

Contributors

evsar3 avatar hristonev avatar kashmiry avatar mrdarkest avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sportmonks-client-bundle's Issues

Filters

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...

Fixtures and Its includes.

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;`

calling fixtures pagination in foreach loop

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?

Setting timezone

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?

filters

How can I use filters?

For example: I want to find seasons with name = '2017/2018'.

Is posible?

How to integrate API

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.

Is there a reason data held as stdClass Object and not array

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?

Fixtures are missing pagination method

Those API endpoints DO implement pagination as per https://www.sportmonks.com/products/soccer/docs/2.0/fixtures/18 docs. This applies to:

  • Fixtures Between 2 Dates
  • Fixtures Between 2 Dates For Team
  • Fixtures For Specific Date

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

H2H Pagination

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.