Twitter Timeline Feed WebPart for SharePoint 2013 based on Twitter API Version 1.1

Ashok Raja
 
Solutions Architect
March 9, 2013
 
Rate this article
 
Views
1160

This Twitter Timeline Feed WebPart for SharePoint 2013 is based on Twitter API version 1.1 which has many breaking changes when compared to Version 1.0 of API.

Twitter have already started blackout test on Version 1.0 of API form 5th March 2013 onwards. The existing widgets and custom controls that were built for Twitter based on Version 1.0 of API may stop working anytime during this month.

Major Changes

1. No more un-authenticated Twitter API calls

2. Almost all API’s now returns data in “json” format only

3. Rate Limits has been implemented. Rate limit is basically nothing but the number of requests permitted for an API call during a specified period of time.

Note: Checkout this link to view Rate limits for all Twitter APIs that are based on Version 1.1

WebPart

Now let’s see what’s there in the Twitter TimeLine WebPart for SharePoint 2013.

This WebPart renders output in 2 modes. One is Twitter Timeline widget mode and another option is custom rendering mode.

Twitter Timeline Rendering Mode

This mode requires a Twitter Widget Id and Twitter Handler as input to render the content. This twitter widget Id can be secured by creating a new Embedded Timeline widget in Twitter. Follow the steps listed in this link to create a new Embedded Timeline widget

Deployment

1. Build and deploy the attached solution.

2. Activate the feature “SFS.Intranet.TwitterFeed

3. Add the WebPart “Twitter Feed WebPart” located under “SharePoint Frontier” Category to a page

4. Edit the WebPart and go to the settings of WebPart and chose “TwitterTimeLine” as rendering mode

5. Provide values to Widget ID and Twitter Handler

6. Click “Ok” to save the changes

The expected output for this rendering mode can be seen bellow

timelinemode

Custom Rendering Mode

If you would like to have a Twitter Feed WebPart with a custom branding then this would be the option you have to go for. You can customize the “.ascx” to apply specific branding related elements to your WebPart. This method performs an API call to Twitter to fetch the content in “json” format. The data received from Twitter is bound to a repeater for presentation.

This rendering mode requires Consumer Key, Consumer Secret, Access Token, and Access Token Secret from Twitter. To generate these items for your Twitter Account follow the steps listed in this link.

Deployment

1. Follow the steps from 1 to 3 mentioned in Twitter Timeline mode

2. Edit the WebPart and go to the settings of WebPart and chose “Custom” as rendering mode

3. Provide values for Consumer Key, Consumer Secret, Access Token and Access Token Secret. Instead of providing these values as properties you can change the code to get it from web.config or from any other secure location.

customModeSettings

4. Click “Ok” to save the changes

The expected output for this rendering mode can be seen bellow

custom

Download Source Code

Author Info

Ashok Raja
 
Solutions Architect
 
Rate this article
 
I am Ashok Raja, Share Point Consultant and Architect based out of Chennai, India. ...read more
 

Leave a comment