PHP code example of evansims / socialworth

1. Go to this page and download the library: Download evansims/socialworth 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/ */

    

evansims / socialworth example snippets


    use Evansims\Socialworth;

    $socialworth = new Socialworth('https://github.com/');
    var_dump($socialworth->all());
    

    use Evansims\Socialworth;

    var_dump(Socialworth::twitter('https://github.com/'));
    

    use Evansims\Socialworth;

    $socialworth = new Socialworth('https://github.com/');
    $socialworth->linkedin = false;

    var_dump($socialworth->all());
    

    use Evansims\Socialworth;

    $socialworth = new Socialworth('https://github.com/');
    $response = $socialworth->all();

    var_dump($response->total); // Total likes, shares, upvotes, etc.
    var_dump($response->reddit); // Just shares and upvotes from reddit.
    var_dump($response->twitter); // Just mentions, retweets and shares on Twitter.