How to get your tweets displaying on your website using JavaScript, without using new Twitter 1.1 API Check out code here: http://jasonmayes.com/projects/twitterApi/  - tested in IE 7, 8, 9 and 10, Firefox, Chrome, Safari and Opera :-)

Today I was quite frustrated to find out that the old API on #Twitter was depreciated and the overhead in setting up a system to perform #OAUTH just to get my already publicly available tweets was too damn high (see https://dev.twitter.com/discussions/11564 ). Even worse I couldn't find any simple solutions for #JavaScript . All code examples were server side. So after much thinking I invented the following workaround solution. It makes use of the over bloated widgets Twitter gives us to put on our sites, cuts out all the nonsense, and returns to you your raw tweet text so you can do with it as you please on your website. Instructions on how to get it working with your tweets are in the code comments, just do what it says!  Check out my JS fiddle here: http://jasonmayes.com/projects/twitterApi/  Enjoy!

UPDATE: Due to popular demand, you can now specify how many tweets you want returned which can be any number between 1 and 20, as the third parameter to the function call :-) Let me know if you have any other requests.

UPDATE 2: Due to even more requests, my solution now gets recent tweets for user, favourite tweets, list tweets, or hashtag search!

UPDATE 3: My script now handles writing HTML to an element with an ID of your choice making it even simpler to use and allows you to queue up many requests so you can have many items on the same page doing different things eg one shows recent posts with a specific hashtag, whilst the other shows your latest 5 tweets. 

UPDATE 4: Script now supports grabbing who posted the tweet, their profile photo, and link to profile. Also adds the time they posted at the end. All customizable with CSS to look how you want.

UPDATE 5: You can now specify a custom date formatting function to format the twitter post date however you wish! See comments for how to use.

Now on GitHubhttps://github.com/jasonmayes/Twitter-Post-Fetcher

For further updates please see the project website: http://jasonmayes.com/projects/twitterApi/  all new updates etc will be pushed live here in the future. Questions? Ask below.

#Solution #API #TwitterAPI  
Photo
Shared publiclyView activity