php - Retrieving Twitter Data based on twitter ID in codeigniter Using OAuth -
i using script fetch data of particular twitter user id
the twitter user id 1897279429
i want show name , image
i have following script using twitter library
$this->load->config('twitter'); require_once apppath.'libraries/twitterapiexchange.php'; $settings = array( 'oauth_access_token' => $this->config->item('access_token'), 'oauth_access_token_secret' => $this->config->item('access_token_secret'), 'consumer_key' => $this->config->item('consumer_key'), 'consumer_secret' => $this->config->item('consumer_secret') ); /** perform request , echo response **/ /** note: set field before calling buildoauth(); **/ $url = 'https://api.twitter.com/1.1/followers/ids.json'; $getfield = '?username=saswatroutroy'; $requestmethod = 'get'; $twitter = new twitterapiexchange($settings); echo $twitter->setgetfield($getfield) ->buildoauth($url, $requestmethod) ->performrequest();
the issue want name , url of profile picture displayed,
but instead following
{"ids":[],"next_cursor":0,"next_cursor_str":"0","previous_cursor":0,"previous_cursor_str":"0"}
now may because dont have follower, , url wrong
but want appropriate way , url
can me in issue??
thanks in advance
it's not you. put user id twython script have them , got this:
bash-3.2$ ./id-show.py user show: 1897279429 traceback (most recent call last): file "./id-show.py", line 14, in <module> data = twitter.show_user(user_id=target) file "build/bdist.macosx-10.3-fat/egg/twython/endpoints.py", line 426, in show_user file "build/bdist.macosx-10.3-fat/egg/twython/api.py", line 230, in file "build/bdist.macosx-10.3-fat/egg/twython/api.py", line 224, in request file "build/bdist.macosx-10.3-fat/egg/twython/api.py", line 194, in _request twython.exceptions.twythonerror: twitter api returned 403 (forbidden), user has been suspended. bash-3.2$
so there have it, whoever has been suspended.
Comments
Post a Comment