You are here: Blog » Code Snippets » Twitter API 1.1 Example

Twitter API 1.1 Example

small_8476983849

In the footer of this website, I show my latest tweet. Until now I had been using Twitter API 1.0. Today Twitter stopped service for API 1.0 and I had to scramble to fix it so that it would work with Twitter API 1.1 (turns out it’s a lot more complicated). Here is the code I ended up using in case anyone needs it.

Do This First

Go to dev.twitter.com and create an app. This will provide you with the credentials you need to access your Twitter feed.

Credits

Hats off to Rivers from this article on Stack Overflow who really figured this one out. All I did was modify it to echo out each Tweet (I also set it to use only one tweet).

 

Do you find this snippet helpful? Have questions or suggestions? Let me know.

photo credit: mkhmarketing via photopin cc

This entry was posted in Code Snippets and tagged , by .

Author: justin saad

Justin Saad is first and foremost a husband and a father of four. He is also a web developer and designer who has been making websites for over twenty years. His company is called The Motech Network and his website is ClevelandWebDeveloper.com. In addition to building websites, Justin makes WordPress plugins and likes writing tutorials to help others learn about various aspects of web development.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">