Everything, Everything

2024: January February March
2023: J F M A M J J A S O N D
2022: J F M A M J J A S O N D
2021: J F M A M J J A S O N D
2020: J F M A M J J A S O N D
2019: J F M A M J J A S O N D
2018: J F M A M J J A S O N D
2017: J F M A M J J A S O N D
2016: J F M A M J J A S O N D
2015: J F M A M J J A S O N D
2014: J F M A M J J A S O N D
2013: J F M A M J J A S O N D
2012: J F M A M J J A S O N D
2011: J F M A M J J A S O N D
2010: J F M A M J J A S O N D
2009: J F M A M J J A S O N D
2008: J F M A M J J A S O N D
2007: J F M A M J J A S O N D
2006: J F M A M J J A S O N D
2005: J F M A M J J A S O N D
2004: J F M A M J J A S O N D
Twitter API
Wednesday 19th June, 2013 15:48 Comments: 0
It took me about a week to notice that the tweets displayed on my home page hadn't updated, due to the excellent validation and caching of data that I'd implemented. It turns out that Twitter have finally stopped supporting their original API. To be fair to them, they did announce almost a year ago that this was going to happen, and then extended the date until June 11th.

Normally a minor release would mean hardly any changes. I figured it'd be a few simple tweaks to my existing code. I was wrong.

Firstly, XML, RSS, and ATOM support has been dropped (I used XML before). They only support JSON output (luckily, PHP has decent support for JSON).

Secondly, you need to authenticate using OAuth. The entire 1.1 API requires a user context when authenticating, so an oauth_token representing an access token must be present in each request. It turns out you can log into https://dev.twitter.com/apps with your Twitter account and create an application to generate an OAuth token. Simples.

After that it wasn't difficult to use my existing code to validate and cache (and make pretty) the same information that I'd been accessing before.

For more information, the REST API v1.1 is available here. With all the changes, I would have called it v2.0.
© Robert Nicholls 2002-2024
The views and opinions expressed on this site do not represent the views of my employer.
HTML5 / CSS3