Question

We were using Twitter v1 to embed our latest tweets into our website.

<script type="text/javascript" src="https://api.twitter.com/1/statuses/user_timeline/[handle].json?callback=twitterCallback2&amp;count=2"></script>

I understand that we have to use v1.1 now

{"errors": [{"message": "The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.", "code": 68}]}

I have set up all the api and auth keys but I am not going to use the php example

Is it possible to just replace the current javascript with a new one using something from the 1.1 api.

All we really need is to embed the latest 3 tweets.

Was it helpful?

Solution

With 1.1, calls to user timeline need to be authenticated. But Twitter has devised an simple process to create a client side embedded timeline. It requires creating a widget through the settings page. Here are the instructions:

Creating an Embeddable Timeline


You can further customize the look of the widget on the client side by changing any one of client side options:

Client Side Options


To get the latest 3 tweets, make sure to set your tweet limit to 3. It would look similiar to this:

<a class="twitter-timeline" href="https://twitter.com/twitterapi" data-widget-id="YOUR-WIDGET-ID-HERE" data-chrome="nofooter" data-tweet-limit="3">Tweets by @twitterapi</a>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top