PHP code example of thesmart / php-topsy

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

    

thesmart / php-topsy example snippets


$topsy = new TopsyApi('my api key', 'example.com');
try {
	$result = $topsy->api('authorinfo', array('url' => 'http://twitter.com/thesmart'));
} catch (TopsyApiException $tae) {
	error_log('Topsy error message: ' . $tae->getMessage());
	error_log('Topsy status code: ' . $tae->getCode());
}

array (
	'name' => 'John Smart',
	'nick' => 'thesmart',
	'description' => 'Chief Architect and CoFounder of Zoosk.com. Geeky and profound, enjoying the ride.',
	'influence_level' => 0,
	'url' => 'http://twitter.com/thesmart',
	'image_url' => 'http://a0.twimg.com/profile_images/1508630405/Screen_shot_2011-02-23_at_3.10.25_PM.png_normal.jpg',
	'type' => 'twitter',
	'topsy_author_url' => 'http://topsy.com/twitter/thesmart',
);