Giter VIP home page Giter VIP logo

hltv-api's Introduction

PHP hltv-api

The hltv based module for the automatic event grabbing

About

  1. What is it? This is PHP code for parsing Hltv requests.

  2. What can it do? It can get actual match-list, get detailed match-info for single match.

  3. What I need to work with it? First of all you need web-server with PHP 7.0+ ( PDO and cURL should be enabled). Then look at install section.

Install

  1. Install via Composer:

    {
        "require": {
            "webrepin/hltv-api": "*"
        }
    }
  2. Initialize Hltv-Api like this:

    require_once 'vendor/autoload.php';
    
    use HltvApi\Client;
    
    $client = new Client();
  3. Supported list of requests is:

    Requests

    Type URL
    Supported
    ongoing https://www.hltv.org/matches
    upcoming https://www.hltv.org/matches
    results https://www.hltv.org/results
    matchDetails https://www.hltv.org/matches/xxxx-xxxx-xxxxx
  4. All request return object abstract layer based on Entity

    use HltvApi\Entity\Entity;

    Example how to getting ongoing match list:

    require_once 'vendor/autoload.php';
        
    use HltvApi\Client;
    
    $client = new Client();
    
    $matches = $client->ongoing();
    
    foreach ($matches as $match) {
       echo $match->getTeam1();
       echo $match->getTeam2();
       echo $match->getMatchUrl();
       echo $match->getMatchUrl();
    }

    Follow the match details:

    echo $match->details()->getOdds()
    echo $match->details()->getMapName(1)
    echo $match->details()->getMapScore(1)
    echo $match->details()->getMapResults(1)
  5. To getting more stability you can protect your request by using Proxy list

    require_once 'vendor/autoload.php';
        
    use HltvApi\Client;
    
    $client = new Client([
       ['0.0.0.0', '80', CURLPROXY_SOCKS5],
       ['0.0.0.0', '443', CURLPROXY_HTTP],
       ...
    ]);
    

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.