Twitter Sample

April 22, 2013 |

Twitter Demonstration
 
Displays status messages (tweets) for a Twitter account:



Displays status messages (tweets) for a Twitter account using a custom LayoutTemplate and StatusTemplate:

Displays Twitter search results for 'Ajax Control Toolkit':

Twitter Description 
 
The Twitter control is an ASP.NET AJAX control that enables you to display Twitter status messages (tweets) from Twitter.com. This control has two modes: Profile and Search. In Profile mode, you can display the latest tweets from a particular user by supplying the user's Twitter screen name. In Search mode, you can display all tweets which match a search query.

Twitter limits the number of times that you can interact with their API in an hour. Twitter recommends that you cache results on the server (https://dev.twitter.com/docs/rate-limiting). By default, the Twitter control caches results on the server a duration of 5 minutes. You can modify the cache duration by assigning a value (in seconds) to the Twitter control's CacheDuration property.

The Twitter control wraps a standard ASP.NET ListView control. You can customize the appearance of the Twitter control by modifying its LayoutTemplate, StatusTemplate, AlternatingStatusTemplate, and EmptyDataTemplate.


Twitter Properties 
 
<ajaxToolkit:Twitter 
            Mode="Profile"
            ScreenName="ScottGu" 
            runat="server" />
  • Mode - either Profile or Search mode.
  • ScreenName - required in Profile mode. The Twitter user to display.
  • Search - required in Search mode. The search to perform. You can build complex queries with search operators
  • Count - number of status messages (tweets) to display. The default value is 5.
  • CacheDuration - amount of time to cache results from Twitter in seconds. The default value is 300 seconds.
  • IncludeRetweets - in Profile mode, indicates whether retweets are displayed.
  • IncludeReplies - in Profile mode, indicates whether replies are displayed.
  • LayoutTemplate - template which contains the HTML for the root container of the ListView content.
  • StatusTemplate - template which contains each status message (tweet).
  • AlternatingStatusTemplate - template which is applied for alternating status messages (tweets).
  • EmptyDataTemplate - template which displays content when there are no tweets.
  • Title - enables you to display title text in the header. In Profile mode, the default value is the full user name.
  • Caption - enables you to display caption text in the header. In Profile mode, the default value is the user screen name.

0 comments:

Post a Comment