This morning I have received the dreaded 'The Twitter REST API v1 is no longer active. Please migrate to API v1.1.' error in a few of my web sites.
Previously I have been using javascript/json to make these calls to http://api.twitter.com/1/statuses/user_timeline.json? to display a timeline.
As this is no longer available I need to adopt the new 1.1 API process.
I need to do the following using HttpWebRequest objects not a 3rd party application:
- Authenticate using oauth key and secret
- Make an authenticated call to pull back to display users timeline
Created a JS only solution to get Twitter posts on your site without using new API - can now specify number of tweets too: http://goo.gl/JinwJ
Here is what I did to get this working in a simple example.
I had to generate an oAuth consumer key and secret from Twitter at:
https://dev.twitter.com/apps/new
I deserialized the authentication object first to get the token and type back in order to authenticate the timeline call.
The timeline call simply reads the json as that is all I need to do, you may want to deserialize it yourself into an object.
I have created a project for this at : https://github.com/andyhutch77/oAuthTwitterWrapper
Update - I have updated the github project to include both asp .net web app & mvc app example demos and nuget install.