We are developing an TYPO3 CMS extension that is in charge of managing the social network profiles. In this case Twitter. The API works with TYPO3 through Adapter Pattern.
Now, I have different Twitter profiles and I select in the view in which I want to publish (through a checkbox) and send a text that I want to publish in the chosen profiles.
The method to publish in Twitter is:
require $extensionPath . 'twitteroauth/autoload.php';
use Abraham\TwitterOAuth\TwitterOAuth;
...
public function doPublication($profile, \Vendor\MyExt\Domain\Model\Post $publication) {
$status = $publication->getText();
if(strlen($status)>=140)
$status = substr($status,0,139);
$this->api = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token, $access_token_secret);
$this->api->post('statuses/update', array('status' => "$status"));
}
At this moment We are not using the profile name to publish, because We can not find a feature within the Twitter API to send a Post to a determined profile.
My question is if can define in some way the profile to which you want to publish. Because I have not found it yet.
In addition to this, the publication is always being made to a one profile of the list to choose, even if it is not selected. Always appears in the response json when executing statuses / update.