#!/usr/bin/env php . */ define('INSTALLDIR', realpath(__DIR__ . '/../..')); require_once INSTALLDIR . '/extlib/OAuth.php'; $shortoptions = 't:s:u:'; $longoptions = ['oauth_token=', 'oauth_token_secret=', 'update=']; $helptext = <<sign_request($hmac_method, $consumer, $atok); $httpReq = httpRequest($endpoint, $oauthReq->to_postdata()); echo $httpReq->getBody(); } catch (Exception $e) { echo "Error! . {$e->getMessage}() . 'HTTP reponse body: " . $httpReq->getBody(); exit(1); } function httpRequest($endpoint, $poststr) { $request = HTTPClient::start(); $request->setConfig( [ 'follow_redirects' => true, 'connect_timeout' => 120, 'timeout' => 120, 'ssl_verify_peer' => false, 'ssl_verify_host' => false, ] ); // Turn signed request query string back into an array parse_str($poststr, $postdata); return $request->post($endpoint, null, $postdata); }