A PHP alternative to the Twitter Embed Timelines JavaScript.
Twitter Embedded Timelines allow you to show your latest tweets using JavaScript. While this can help you easily implement your latest tweets on you website, I needed to create a similar effect without including any additional JavaScript files on the web page.
I decided to create a script that will fetch tweets server-side, and allow for including in a web page without JavaScript includes. I also needed to ensure I cached the result, to avoid hitting API limits.
Using the popular TwitterOAuth PHP Library for authentication, we can access the Twitter Rest API.
Works with PHP 5.3+ through to PHP 8.1+.