Mr. Igor Brigadir
Thank you for your comment.
In communication with Twitter using Twitter API, I paid out “Consumer Keys” API Key, API Secret,
We have set 4 access tokens and access token secrets for “Access Token”.
However, the tweet of “@uhbnews_uhb” has not been acquired.
Therefore, I would like you to investigate the status of “Consumer Keys” of “@uhbnews_uhb”.
In addition, since the test program (exec_twitter_sample.php) is described at the end of the text.
I would like you to check it by all means.
In addition, the API Key and API Secret of “Consumer Keys” are not displayed at the following URL.
Even if you “Regenerate”, it is in the same state.
- Please check the attached image.
> ◇ URL
> https://developer.twitter.com/en/portal/apps/ (AppId of @uhbnews_uhb) / keys
On this screen, when the developer account application is approved, the API Key of “Consumer Keys”,
We are aware that the API Secret will be issued and displayed.
I will tell you again, but if my recognition is correct, please do. Of “@uhbnews_uhb”
Please investigate the status of “Consumer Keys”.
If you have any reason why you cannot carry out the survey, please answer. We will contact you with the necessary information.
that’s all, thank you very much.
exec_twitter_sample.php
<?php
require_once("twitteroauth-master/autoload.php");
require_once("twitteroauth-master/src/TwitterOAuth.php");
use Abraham\TwitterOAuth\TwitterOAuth;
// API key
$tw_consumer_key = (Issued consumer key);
// API secret key
$tw_consumer_secret = "(Issued consumer secret)";
// access_token
$tw_access_token = "(Issued access token)";
// access_token secret
$tw_access_token_secret = "(Issued access token secret)";
function get_tw_object()
{
global $tw_consumer_key, $tw_consumer_secret, $tw_access_token, $tw_access_token_secret, $proxy;
$obj = null;
$obj = new TwitterOAuth($tw_consumer_key, $tw_consumer_secret, $tw_access_token, $tw_access_token_secret);
return $obj;
}
$tw = get_tw_object();
if($tw == null){
throw new Exception('Twitter error: OAuth object creation failed ');
}
// Timeline
$res = $tw->get('statuses/home_timeline', array('count' => 5));
var_dump($res);
?>