Display Tweets from Twitter for API 1.1

Display Tweets from Twitter for API 1.1

Play this article

Twitter as of 11th of June 2013 has turned off access to its API version 1.0. All requests now need to use version 1.1 this means all requests must first be authenticated using oAuth! Also to display your tweets on a website a Twitter app must first be created.

The official Twitter widget

Twitter does provide a widget to embed tweets at https://twitter.com/settings/widgets

Once the widget is created the page provides a few lines of javascript copy and past that into your page to use.

<p>Which results in following widget being shown:</p>

<p><img alt="" src="/assets/images/blog/tutorials/Screen-Shot-2013-06-15-at-09.04.37.png" style="height:614px; width:528px" /></p>

<p>It&#39;s a nice looking widget but there&#39;s going to be times when you want to have full control over the layout and style.</p>


<p>A jQuery plugin I&#39;ve used in the past its very flexible and can be styled very easily, this plugin has stopped working with the Twitter API update but thanks to <a href="http://'https://github.com/StanScates">Stan Scates</a>&nbsp;who has written an update <a href="https://github.com/StanScates/Tweet.js-Mod">https://github.com/StanScates/Tweet.js-Mod&nbsp;</a>which works perfectly with seoofcloud!</p>

<h1>How to use it</h1>

<p>Download the twitter file from github then update twitter/index.php with the settings from your twitter app (you will need to create an app first at <a href="https://dev.twitter.com/apps">https://dev.twitter.com/apps</a>) then include jquery and the updates tweet js file:</p>

<code class="language-javascript"><script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
<script language="javascript" src="twitter/jquery.tweet.js" type="text/javascript"></script>

Then call the js function to display the tweets.

<p>Adjust the parameters as needed (To see the full list of options look inside jquery.tweet.js) next create a div for jquery to add the tweets too.</p>

<div class="tweet"></div>

The result is a simple html list that can easily be styled with your own css or by using the CSS file from seoofclouds

Did you find this article valuable?

Support David Carr by becoming a sponsor. Any amount is appreciated!