Created
February 1, 2013 09:57
-
-
Save mattbrailsford/4690436 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using System.Configuration | |
@using Twitterizer | |
@inherits Umbraco.Web.Mvc.UmbracoViewPage<Umbraco.Web.Models.PartialViewMacroModel> | |
@{ | |
var tokens = new OAuthTokens | |
{ | |
ConsumerKey = ConfigurationManager.AppSettings["twitterConsumerKey"], | |
ConsumerSecret = ConfigurationManager.AppSettings["twitterConsumerSecret"], | |
AccessToken = ConfigurationManager.AppSettings["twitterAccessToken"], | |
AccessTokenSecret = ConfigurationManager.AppSettings["twitterAccessTokenSecret"] | |
}; | |
var response = TwitterTimeline.UserTimeline(tokens, new UserTimelineOptions | |
{ | |
ScreenName = Model.CurrentPage.GetPropertyValue<string>("twitterId", true, ""), | |
Count = 1 | |
}); | |
} | |
<div class="tweet"> | |
@if(response.Result == RequestResult.Success) | |
{ | |
var tweet = response.ResponseObject.First(); | |
<span>@Html.Raw(tweet.LinkifiedText())</span> | |
<a href="http://twitter.com/@(tweet.User.ScreenName)/status/@(tweet.Id)">@tweet.CreatedDate.ToString()</a> | |
} | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment