Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ Download the twitter.php to your application/library directory
Replace variables in the twitter.php library with your own and you're good to go.

Check out the twitterexamples.php controller for some example requests

Featured added:
- Added a config file for nice and ease configurations set up.
16 changes: 16 additions & 0 deletions configs/twitter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');



$config['consumerKey'] = 'Enter your consumer key here';
$config['consumerSecret'] = 'Enter your consumer secret here';
$config['oAuthToken'] = 'Enter your access token here';
$config['oAuthSecret'] = 'Enter your access token secret here';
$config['oAuthSignature'] = '';
$config['oAuthSignatureMethod'] = 'HMAC-SHA1';
$config['oAuthTimeStamp'] = date('U');
$config['oAuthVersion'] = '1.0';


/* End of file twitter.php */
/* Location: codeigniter-twitter-library/configs/twitter.php */
File renamed without changes.
18 changes: 10 additions & 8 deletions twitter.php → libraries/twitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,17 @@ class Twitter

function __construct()
{
$this->_consumerKey = 'Enter your consumer key here';
$this->_consumerSecret = 'Enter your consumer secret here';
$this->_oAuthToken = 'Enter your access token here';
$this->_oAuthSecret = 'Enter your access token secret here';
$this->config->load('twitter');

$this->_consumerKey = $this->config->item('consumerKey');
$this->_consumerSecret = $this->config->item('consumerSecret');
$this->_oAuthToken = $this->config->item('oAuthToken');
$this->_oAuthSecret = $this->config->item('oAuthSecret');
$this->_oAuthNonce = $this->generateNonce();
$this->_oAuthSignature = '';
$this->_oAuthSignatureMethod = 'HMAC-SHA1';
$this->_oAuthTimeStamp = date('U');
$this->_oAuthVersion = '1.0';
$this->_oAuthSignature = $this->config->item('oAuthSignature');;
$this->_oAuthSignatureMethod = $this->config->item('oAuthSignatureMethod');
$this->_oAuthTimeStamp = $this->config->item('oAuthTimeStamp');
$this->_oAuthVersion = $this->config->item('oAuthVersion');
}

/*
Expand Down