PHP code example of nickel715 / networker
1. Go to this page and download the library: Download nickel715/networker 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/ */
nickel715 / networker example snippets
$username = 'nickel715';
$credentials = array(
'consumer_key' => '',
'consumer_secret' => '',
'oauth_token' => '',
'oauth_token_secret' => '',
);
$twitterAuth = new \TwitterOAuth\Auth\SingleUserAuth($credentials, new \TwitterOAuth\Serializer\ArraySerializer());
$importNetwork = new Network\Twitter;
$importNetwork->setTwitter($twitterAuth);
$userList = $importNetwork->getAll($username);
$storage = new Storage\File('userlist.txt');
$storage->addAll($userList);
$exportNetwork = new Network\Pinboard;
$exportNetwork->setHttpClient(new \Zend\Http\Client);
foreach ($storage->findAll() as $user) {
if ($exportNetwork->userExists($user)) {
echo $exportNetwork->getUserLink($user), PHP_EOL;
}
}