PHP code example of websuckit / websuckit-php

1. Go to this page and download the library: Download websuckit/websuckit-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

websuckit / websuckit-php example snippets




use Websuckit\WebsuckitPhp\Config;
use Websuckit\WebsuckitPhp\Websuckit;

$config = new Config($_ENV['USER_ID'], $_ENV['ACCESS_KEY'], $_ENV['PUBLIC_KEY']);
$websuckit = new Websuckit($config);

use Websuckit\WebsuckitPhp\Types\ChannelConnectionUrlConfig;

$channel = new ChannelConnectionUrlConfig('CHANNEL-NAME', 'CHANNEL-PASS-KEY', false);
$connection_url = $websuckit->getConnectionUrl($channel);

$channel = $websuckit->createChannel('new-channel', 2);

$channel = $websuckit->getChannel('CHANNEL-NAME');

$page = "0";
$per_page = "10";

//search variable that can be null
$search = "search-term"
$channels = $websuckit->getChannels($page, $per_page, $search);

$channel = $websuckit->getOrCreateChannel('CHANNEL-NAME');


$channel = $websuckit->updateChannel('CHANNEL-ID', "CHANGE-CHANNEL-NAME", false, 2);

$websuckit->deleteChannel('CHANNEL-ID');
bash
composer