php - Laravel and Thujohn's Twitter Package -
i have implemented thujohn's twitter api bundle laravel (https://github.com/thujohn/twitter-l4). able set , included api credentials.
when go home view view tweets,
stdclass object ( [errors] => array ( [0] => stdclass object ( [message] => bad authentication info [code] => 215 ) ) )
(i printing out info debugging)
i have tried other methods trying users timeline, homecoming same thing.
i have made helper class help behind scenes work retrieval of data. have set laravel , made class folder.
here helper class:
class helpers { public static function twitterfeed($screen_name='mackhankins', $count='3', $include_retweets='false', $exclude_replies='true') { $twitterfeed = cache::remember('twitterfeed', 30, function() utilize ($screen_name, $count, $include_retweets, $exclude_replies) { homecoming twitter::getusertimeline(array('screen_name' => $screen_name, 'count' => $count, 'include_rts' => $include_retweets, 'exclude_replies' => $exclude_replies)); }); if(!empty($twitterfeed)) { homecoming $twitterfeed; } else { homecoming array(); } } }
the homecontroller:
class homecontroller extends basecontroller { public function __construct() { /*get tweets*/ view::share('tweets', helpers::twitterfeed('tjyouschak', '10', false, true)); } public function gethome() { homecoming view::make('home'); } }
the view:
{{ print_r($tweets) }}
any help appreciated, thanks!
code 215 bad authentication data. need auth first, tweets
https://dev.twitter.com/overview/api/response-codes
https://dev.twitter.com/rest/reference/get/search/tweets
php twitter laravel
No comments:
Post a Comment