2

我想在我的项目中实现 Twitter 登录。我的项目是用 CodeIgniter 编码的。有人可以给我一个逐步的过程来实现这个吗?

4

3 回答 3

3

只需参考以下链接-integration -twitter-api-with-codeigniter

Auth---第三方认证

于 2012-11-06T06:44:49.387 回答
2
//use  Codeigniter-TwitterOAuth
//https://github.com/MunGell/Codeigniter-TwitterOAuth
//download url: https://github.com/MunGell/Codeigniter-TwitterOAuth/archive/master.zip
//Usage

  //  There are two ways to load library to Codeigniter. Automatically within ./config/autoload.php or directly in your controller by adding this line:

    $this->load->library('twitteroauth');

    //Create an instance:

    $connection = $this->twitteroauth->create($consumer, $consumer_secret, $access_token, $access_token_secret);

    //Verify your authentication details:

    $content = $connection->get('account/verify_credentials');

    //Send a message:

    $data = array(
        'status' => $message,
        'in_reply_to_status_id' => $in_reply_to
    );
    $result = $connection->post('statuses/update', $data);
于 2014-03-23T09:21:11.747 回答
0

嗨,试试 philsturgeon oauth的这个 oauth 库

于 2012-11-06T06:26:59.147 回答