public TwitterTimelineResponse GetRecentTweets(int blogId)
        {
            TwitterTimelineResponse latestTweets = default(TwitterTimelineResponse);

            try
            {
                var blogHome = Umbraco.TypedContent(blogId);
                if (blogHome != null)
                {
                    var twitterAccount = blogHome.HasProperty("authenticatedTwitterAccount") && blogHome.HasValue("authenticatedTwitterAccount") ? blogHome.GetPropertyValue <TwitterOAuthData>("authenticatedTwitterAccount") : default(TwitterOAuthData);
                    if (twitterAccount != null)
                    {
                        //get twitter service using authenticated twitter details
                        Skybrud.Social.Twitter.TwitterService service = twitterAccount.GetService();
                        //get last 5 tweets
                        latestTweets = service.Statuses.GetUserTimeline(twitterAccount.ScreenName, 5);
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(typeof(TweetThisApiController), "Error Retrieving Timeline", ex);
            }
            return(latestTweets);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets a list of favorites based on the specified <code>options</code>.
 /// </summary>
 /// <param name="options">The options for the call to the API.</param>
 public TwitterTimelineResponse GetFavorites(TwitterGetFavoritesOptions options)
 {
     return(TwitterTimelineResponse.ParseResponse(Raw.GetFavorites(options)));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Gets a list of favorites of the user with the specified <code>screenName</code>.
 /// </summary>
 /// <param name="screenName">The screen name of the user.</param>
 public TwitterTimelineResponse GetFavorites(string screenName)
 {
     return(TwitterTimelineResponse.ParseResponse(Raw.GetFavorites(screenName)));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Gets a list of favorites of the user with the specified <code>userId</code>.
 /// </summary>
 /// <param name="userId">The ID of the user.</param>
 public TwitterTimelineResponse GetFavorites(long userId)
 {
     return(TwitterTimelineResponse.ParseResponse(Raw.GetFavorites(userId)));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Gets a list of favorites of the authenticated user.
 /// </summary>
 public TwitterTimelineResponse GetFavorites()
 {
     return(TwitterTimelineResponse.ParseResponse(Raw.GetFavorites()));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Gets the timeline of the user with the specified <code>userId</code>.
 /// </summary>
 /// <param name="userId">The ID of the user.</param>
 public TwitterTimelineResponse GetUserTimeline(long userId)
 {
     return(TwitterTimelineResponse.ParseResponse(Raw.GetUserTimeline(userId)));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Returns the most recent tweets authored by the authenticating user that have been retweeted by others.
 /// </summary>
 /// <param name="options">The options for the call.</param>
 public TwitterTimelineResponse GetRetweetsOfMe(TwitterTimelineOptions options)
 {
     return(TwitterTimelineResponse.ParseResponse(Raw.GetRetweetsOfMe(options)));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Returns the most recent tweets authored by the authenticating user that have been retweeted by others.
 /// </summary>
 /// <param name="count">The maximum amount of tweets to return.</param>
 public TwitterTimelineResponse GetRetweetsOfMe(int count)
 {
     return(TwitterTimelineResponse.ParseResponse(Raw.GetRetweetsOfMe(count)));
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Gets the most recent mentions (tweets containing the users's @screen_name) for the authenticating user.
 /// </summary>
 /// <param name="options">The options for the call to the API.</param>
 public TwitterTimelineResponse GetMentionsTimeline(TwitterTimelineOptions options)
 {
     return(TwitterTimelineResponse.ParseResponse(Raw.GetMentionsTimeline(options)));
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Gets the most recent mentions (tweets containing the users's @screen_name) for the authenticating user.
 /// </summary>
 /// <param name="count">The maximum amount of tweets to return.</param>
 public TwitterTimelineResponse GetMentionsTimeline(int count)
 {
     return(TwitterTimelineResponse.ParseResponse(Raw.GetMentionsTimeline(count)));
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Gets a collection of the most recent tweets and retweets posted by the authenticating
 /// user and the users they follow.
 /// </summary>
 public TwitterTimelineResponse GetHomeTimeline()
 {
     return(TwitterTimelineResponse.ParseResponse(Raw.GetHomeTimeline()));
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Gets the timeline of the user with the specified <code>userId</code>.
 /// </summary>
 /// <param name="screenName">The screen name of the user.</param>
 /// <param name="count">The maximum amount of tweets to return.</param>
 public TwitterTimelineResponse GetUserTimeline(string screenName, int count)
 {
     return(TwitterTimelineResponse.ParseResponse(Raw.GetUserTimeline(screenName, count)));
 }