如何通过点击按钮关注Twitter上的特定用户?

时间:2016-07-18 16:05:12

标签: php twitter

我试过了:

oneway

        $id = "@puppies";
        $toa = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
        $toa->post('friendships/create', array('user_id' => $id));

        $id = "puppies";
        $toa = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
        $toa->post('friendships/create', array('user_id' => $id));

        $id = puppies;
        $toa = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
        $toa->post('friendships/create', array('user_id' => $id));

现在我正在使用Abraham \ TwitterOAuth \ TwitterOAuth库。

1 个答案:

答案 0 :(得分:0)

这有效:

$object = $connection->post('friendships/create', array('screen_name' => 'puppies'));*emphasized text*