0

I've been using this URL https://api.twitter.com/1/statuses/user_timeline.json?screen_name=apolinariosteps&callback=twitterCallback2 but since twitter API 1.0 is now gone, and only 1.1 works, what should I do? I tried https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=apolinariosteps&callback=twitterCallback2but it requires me authentication, I want to display always the same-user timeline in my application so it doesn't make sense to authenticate my user.

So I found this:https://dev.twitter.com/docs/auth/application-only-auth which I couldn't se a way to implement without server side coding, since I'm writing a PhoneGap app, I have no server choice.

What should I do to get to the user's timeline in API 1.1?

My code is

<ul id="twitter_update_list">

</ul>
<script type="text/javascript" src="js/blogger.js"></script>
<script type="text/javascript" src="https://api.twitter.com/1/statuses/user_timeline.json?screen_name=inagaki&callback=twitterCallback2"></script>

blogger.js grabs json and display it into nice <li>s What should I change to make this use the new authentication without server side coding?

steps
  • 774
  • 2
  • 16
  • 38
  • You have to use Application-only auth, but you don't need server code to do so. – Balint Bako Jul 08 '13 at 13:07
  • How could I achieve that then? I couldn't find a way to do so without server side coding. – steps Jul 08 '13 at 13:08
  • To be fair I've used php last time to get this done, because there is a nice oauth plugin for php. But you might be right, it is really cumbersome to get it done only on the client side: http://stackoverflow.com/questions/6700106/twitter-oauth-authentication-in-javascript – Balint Bako Jul 08 '13 at 13:12
  • I agree with @BalintBako, I had to use server side code, since oauth requires custom header with GET request (not AJAX), which is not easy to implement in javascript, I think. – Piyuesh Jul 08 '13 at 16:10

1 Answers1

0

Use GET to retrieve the Json from the following URL and then parse it to get the required JSON attribute using javascript

https://api.twitter.com/1.1/statuses/user_timeline.json?

user_id : The ID of the user for whom to return results for.

min2bro
  • 554
  • 2
  • 9
  • 19