Hi again, no body want’s to help me?
i need find how share a link (ex: t.iost.io/?c=C77e6pno)
that url in twitter search found. but in standard search api not found.
Please help me.
This is my code and return nothing
function queryTwitter($url, $query)
{
// I Myself remove tokens and etc
$oauth_access_token = "s";
$oauth_access_token_secret = "s";
$consumer_key = "s";
$consumer_secret = "s";
$oauth = array(
'oauth_consumer_key' => $consumer_key,
'oauth_nonce' => time(),
'oauth_signature_method' => 'HMAC-SHA1',
'oauth_token' => $oauth_access_token,
'oauth_timestamp' => time(),
'oauth_version' => '1.0'
);
$base_params = empty($query) ? $oauth : array_merge($query, $oauth);
$base_info = buildBaseString($url, 'GET', $base_params);
$url = empty($query) ? $url : $url . "?" . http_build_query($query);
$composite_key = rawurlencode($consumer_secret) . '&' . rawurlencode($oauth_access_token_secret);
$oauth_signature = base64_encode(hash_hmac('sha1', $base_info, $composite_key, true));
$oauth['oauth_signature'] = $oauth_signature;
$header = array(
buildAuthorizationHeader($oauth),
'Expect:'
);
$options = array(
CURLOPT_HTTPHEADER => $header,
CURLOPT_HEADER => false,
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false
);
$feed = curl_init();
curl_setopt_array($feed, $options);
$json = curl_exec($feed);
curl_close($feed);
$response= json_decode($json);
return json_decode(json_encode($response), True);
}
function buildBaseString($baseURI, $method, $params)
{
$r = array();
ksort($params);
foreach ($params as $key => $value) {
$r[] = "$key=" . rawurlencode($value);
}
return $method . "&" . rawurlencode($baseURI) . '&' . rawurlencode(implode('&', $r));
}
function buildAuthorizationHeader($oauth)
{
$r = 'Authorization: OAuth ';
$values = array();
foreach ($oauth as $key => $value)
$values[] = "$key=\"" . rawurlencode($value) . "\"";
$r .= implode(', ', $values);
return $r;
}
$search =queryTwitter( "https://api.twitter.com/1.1/search/tweets.json" , array( 'count' => 100, 'q' => urlencode('t.iost.io/?c=C77e6pno') , "result_type" => "mixed", "include_entities"=>1) );