PHP code example of mpyw / twistoauth
1. Go to this page and download the library: Download mpyw/twistoauth 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/ */
mpyw / twistoauth example snippets
$oauth_verifier = filter_input(INPUT_GET, 'oauth_verifier');
$to->streaming('user', function ($status) use ($to) { ... });
try {
$to->post('statuses/update', array('status' => 'test'));
} catch (TwistException $e) { } // This is very lengthy!!!
curl_exec($to->curlPost('statuses/update', array('status' => 'test'))); // Wow, cool
$a = new TwistOAuth('CK', 'CS');
$b = $a->renewWithRequestToken();
var_dump($a === $b); // false
$obj = new TwistOAuth('a', 'b');
$obj->__construct('c', 'd'); // Break immutable rules
$status->text = htmlspecialchars($status->text, ENT_NOQUOTES, 'UTF-8');
$user->name = str_replace(array('<', '>'), '', $user->name);
$user->description = str_replace(array('<', '>'), '', $user->description);
// You are saying, "Hey libcurl, do not certificate whether I'm really talking to Twitter."
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);