Custom Twitter feed - Twitter API v1.1 - The death of API v1
So it’s dead, API v1 for twitter was put to bed last week: https://dev.twitter.com/blog/api-v1-is-retired
If you weren’t across this – your custom twitter feed that utilises the v1 API would cease to work and you would be trawling through various forums to find sweet FA about anything really….(until now that is)
So what do you need to do to get it back online?
Let’s start at the beginning, what changed to make so many developers scrambling to fix their now legacy feed:
The overview is here however in a nutshell twitter’s shift towards OAuth just got stepped up; you can no longer just slap a screen name at the end of REST call and receive a twitter JSON feed NOW you have create an app and initialise the twitter OAuth.
Quick steps to get you going
Log into twitter and go here & create an app
Once created we need these the values you need to initialise the OAuth:
Dependant on what techonology you used to consume the JSON – there are few open projects located here: https://dev.twitter.com/docs/twitter-libraries
I am simply going to demonstrate a JavaScript One: https://github.com/mynetx/codebird-js
As the documentation suggests – create the Open auth like so:
And make your feed call:
cb.setToken('YOURTOKEN', 'YOURTOKENSECRET'); // see above
cb.__call(
'statuses_userTimeline',
{‘screen_name’:’EXAMPLE SCREENAME’},
function (reply) {
console.log(reply);
}
);