CodeIgniter-Twitter Consumer

Download this library from this link

https://github.com/joshmoody/codeigniter-twitterconsumer

Download  Curl Library for CodeIgniter

https://github.com/philsturgeon/codeigniter-curl/blob/master/libraries/Curl.php

Now place library in system/library folder and configure file in applications config folder

Now do this coding in controller.

<?php
class tw extends CI_Controller{
public function index(){

$this->load->library(‘twitter_consumer’);

// Which API resource do we want to fetch?
$resource = ‘/statuses/user_timeline.json?screen_name=hitesh’;

// Make the call, passing TRUE as 2nd param to restore shortened URLS.
$response = $this->twitter_consumer->request($resource, TRUE);
$t=json_decode($response);
print_r($t);
}
}
?>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s