With the deprecation of Twitter’s API 1 and the official adoption of version 1.1, adding customized tweets to a website has gone from simple to arduous. This PHP timeline starter framework generates a fully customizable, fully CSS-styleable timeline. It should help creators overcome the barriers of OAuth, JSON parsing, and formatting functions so they can get back to designing.
twitter-timeline-php.zip Download twitter-timeline-php.zip
It used to be commonplace to see clever, creative treatments of tweets displayed on websites, particularly portfolios. This trend has more or less collapsed recently, but not because Twitter is any less of a behemoth in social networking. With the deprecation of version 1 of their API, Twitter effectively broke every implementation of good old blogger.js across the web. The landscape of embedding tweets in websites is altered dramatically.
“Assume the embed HTML format will change. The HTML markup for the embed may change over time, so don’t assume classnames or the DOM layout will stay the same. If you need to style the embedded HTML, wrap it in a parent element and style the parent.”
Initially, this was enough to put many people off. Nicely styled Twitter feeds were replaced by boring, default widgets or disappeared off websites entirely (including this blog!).
All of that being said, API 1.1 is powerful and cool, even if the goal isn’t to write the next TweetDeck or Twitterific.
The main issue is the barrier to entry.
There are several hurdles that need to be overcome in order to take advantage of the REST API v1.1 and put custom Twitter timelines on websites.
The first hurdle is the need for a server-side authentication library. The second hurdle is the need to parse a lot of JSON and write all the formatting of timestamps and plaintext tweets manually. The third is writing the logic required to create a timeline that functions in a desirable, Twitter-like, interactive way. Finally, the fourth is the fact that Twitter has far more stringent rules about displaying their content if the API is being used.
Lowering the barrier to entry:
I put together a starter kit that takes care of all four hurdles, or at least lowers them to a manageable height. Its function is to place a fully customizable, fully styleable Twitter user timeline on a website (providing PHP is available).
Available on GitHub.
(Or direct-download the master branch zip file at the top of this post.)
See the GitHub twitter-timeline-php repository to view the README, submit issues, or fork (I’d love to see this translated into other server-side languages).