T
T
tuxx2014-11-14 15:57:28
PHP
tuxx, 2014-11-14 15:57:28

Am I making the right request to follow on Twitter?

With the help of this class I write following users. The code:

$settings = array(
    'oauth_access_token' => "blabla",
    'oauth_access_token_secret' => "blabla",
    'consumer_key' => "blabla",
    'consumer_secret' => "blabla"
);
$url = 'https://api.twitter.com/1.1/friendships/create.json'; 
$requestMethod = 'POST'; 
$twitter = new TwitterAPIExchange( $settings );

foreach($arUser as $name=>$info)
{
    $postField = '?screen_name='.$info->screen_name.'&user_id='.$info->id.'&follow=true';

    $follow = $twitter->setPostfields($postField)->buildOauth($url, $requestMethod)->performRequest();
}

The script is working, but nothing is returned in $follow, although there should be either an error or information about the screen_name user

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question