How much code has to be changed to properly display a user timeline
I got my own API key and API secret and also installed all plugins including whitelist and in-app browser plugins. And built in ios but still could not see any contents. Can you please give me any advice?
Have you got it working?
@chsxe yes, it works well.
@drrasic How much code has to be changed to properly display a user timeline. This works great for home timelines, but say I wanted a specific user. I have messed around with the code, I kind of expected changing the url and taking out the # hashtag would work. I have a work around now, but I don't understand the method of getting it properly.
Some Twitter API endpoints return diferently formated responses, so you have to tweak the controller in some cases, and probably the view in other
For user timeline you would use something like this
var twitterStreamURL = "https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=";
var qValue = "twitter";
and in that case you would change in controller
from
$scope.tweets = tweets.statuses;
to
$scope.tweets = tweets;
So in summary:
- find your endpoint on https://dev.twitter.com/rest/public
- build your custom query
- print raw response to see how it is formated,
- corect the controller(maybe view) to match
I made a demo for this https://github.com/erjin/ionic_twitter_feed
Yes this works 100% fine, thank you @drrasic . Previously I had changed one line of code and made a workaround that displayed tweets from a specific user, along with the @ mentions of that user.