From 86e02c5e537aad2d943f9767cd0e75c64e0d747d Mon Sep 17 00:00:00 2001 From: Jonathan Fontes Date: Fri, 8 Aug 2014 19:32:33 +0100 Subject: [PATCH] Configuration file added and create the folder like codeigniter have. --- README.md | 3 +++ configs/twitter.php | 16 ++++++++++++++++ .../twitterexamples.php | 0 twitter.php => libraries/twitter.php | 18 ++++++++++-------- 4 files changed, 29 insertions(+), 8 deletions(-) create mode 100755 configs/twitter.php rename twitterexamples.php => controllers/twitterexamples.php (100%) rename twitter.php => libraries/twitter.php (93%) diff --git a/README.md b/README.md index 287ec0e..9143d5c 100644 --- a/README.md +++ b/README.md @@ -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. \ No newline at end of file diff --git a/configs/twitter.php b/configs/twitter.php new file mode 100755 index 0000000..d372412 --- /dev/null +++ b/configs/twitter.php @@ -0,0 +1,16 @@ +_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'); } /*