Embed Twitter timeline into a website without OAuth

To embed a twitter timeline or a tweet feed, you have 2 choices : use the widget provided from Twitter or use their 1.1 API.

Using the REST API

This requires an OAuth or an app token, and is limited in queries quantity. But it’s very complete and you can do whatever you want with the data you get.

All info about available data : https://dev.twitter.com/docs/api/1.1

Each query has a rate limiting, divided into 15 minutes intervals : https://dev.twitter.com/docs/rate-limiting/1.1

You can use this to display tweets on your website. But as it’s limited, if there are to many visitors, your queries will be rejected.

The best way would be to get tweets on server side every 5 minutes, save it into the DB so you won’t query twitter api each time the page is loaded.

Using the Twitter widget

The twitter widget is very limited. Its first drawbacks is that you can’t customize the way tweets are displayed. You can always use CSS but it’s limited. It has a few customization options but nothing really advanced.

More info there : https://dev.twitter.com/docs/embedded-timelines

Cheating the Twitter widget

To avoid REST API and its limitations, Jason Mayes has created a JS script to get only tweets from the widget. So you avoid OAuth and limited queries and you get only tweet data so you can process it the way you want.

http://jasonmayes.com/projects/twitterApi/

 

Published by

Louwii

Web developer, geek, car enthusiast, photographer, DIYer, video gamer... I like many things, maybe too many?

Leave a Reply

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